exhtml
1/2/2018 - 6:31 AM

Angular ng-href, ng-src

// Angular's compile process runs after the browser has loaded, 
// so the browser starts to download things like 'src' and 'href' before Angular arrives, 
// we need to use 'ng-href' and 'ng-src' instead, 
// so Angular first evaluates the expression and then sets the attribute, safely.
<a ng-href="#"><img ng-src="profile-{{id}}.jpg"></a>