w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Angular templates optimizations: inlining templates in index.html vs templateCache as js

To say anything more about performance it would have to be measured. But from the theoretical point of view (1) should be more performant since with (2) templates are ending in the $templateCache anyways, and using the <script> directive means additionally: * having those <scripts> in the DOM tree * processing <scripts> tags during the DOM compilation with this directive: https://github.com/angular/angular.js/blob/master/src/ng/directive/script.js

In short: it looks like using <scripts> directive means more runtime processing in a browser. Should be confirmed with some performance testing, but I would assume that one won't see dramatic performance difference.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.