This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/ng-template" id="one.html"> | |
| <div>This is first template</div> | |
| </script> | |
| <script type="text/ng-template" id="two.html"> | |
| <div>This is second template</div> | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Requires angular-mock | |
| describe('$templateCache service', function() { | |
| var service, | |
| httpBackend, | |
| template = "<div>test</div>", | |
| templateResponse = '<script id="test" type="text/ng-template">' + template + '</script>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Example of using an angular provider to build an api service. | |
| * @author Jeremy Elbourn (@jelbourn) | |
| */ | |
| /** Namespace for the application. */ | |
| var app = {}; | |
| /******************************************************************************/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) { | |
| $httpProvider.responseInterceptors.push([ | |
| '$q', '$templateCache', 'activeProfile', | |
| function($q, $templateCache, activeProfile) { | |
| // Keep track which HTML templates have already been modified. | |
| var modifiedTemplates = {}; | |
| // Tests if there are any keep/omit attributes. | |
| var HAS_FLAGS_EXP = /data-(keep|omit)/; |