Created
September 1, 2014 02:37
-
-
Save zefei/c00a5adacbf237e3a1b7 to your computer and use it in GitHub Desktop.
Using Angular and Meteor together: templates (pre Meteor 0.8)
This file contains 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
// for Meteor < 0.8.0 | |
// load Template.* into $templateCache | |
angular.module('myApp') | |
.run(['$templateCache', function($templateCache) { | |
angular.forEach(Template, function(render, name) { | |
// Meteor uses Template to store its own templates, too | |
// Your template file shouldn't start with _ to avoid conflict | |
if (name[0] !== '_') $templateCache.put(name, render()); | |
}); | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment