Skip to content

Instantly share code, notes, and snippets.

View fernandomoraes's full-sized avatar
🏠
Working from home

Fernando Moraes fernandomoraes

🏠
Working from home
View GitHub Profile
<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>
// Requires angular-mock
describe('$templateCache service', function() {
var service,
httpBackend,
template = "<div>test</div>",
templateResponse = '<script id="test" type="text/ng-template">' + template + '</script>';
/**
* Example of using an angular provider to build an api service.
* @author Jeremy Elbourn (@jelbourn)
*/
/** Namespace for the application. */
var app = {};
/******************************************************************************/
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)/;