You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 14, 2019. It is now read-only.
Hardcode ng-href and ng-src support - var protocolRegEx = /^http(s)?/, elements = $('script[src], script[ng-src], link[rel=stylesheet][href], link[rel=stylesheet][ng-href]');
The discussion
As there may be need for support for other tags (img...) and other custom attributes what would be the preferred way to customize the behavior? Give in some kind of map of elements and attributes?
The need
In Angular we use
ng-hrefonlinktags to load custom stylesheet. So we need cache busting to work onng-hrefattribute.The solution
Quick and dirty:
ng-hrefsupport -return content.attribs['ng-href'] || content.attribs.href;. The same way we can hardcodeng-srcsupport.ng-hrefandng-srcsupport -var protocolRegEx = /^http(s)?/, elements = $('script[src], script[ng-src], link[rel=stylesheet][href], link[rel=stylesheet][ng-href]');The discussion
As there may be need for support for other tags (
img...) and other custom attributes what would be the preferred way to customize the behavior? Give in some kind of map of elements and attributes?For ex:
options: { targets: { link: ['href', 'ng-href'], script: ['src', 'ng-src'] } }Open to all ideas. Once we agree on a solution, I'll implement it.