Skip to content

Instantly share code, notes, and snippets.

@aaronfrost
Last active April 29, 2017 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronfrost/5b9a7d7cec01a695d6b78e83c0e86c5a to your computer and use it in GitHub Desktop.
Save aaronfrost/5b9a7d7cec01a695d6b78e83c0e86c5a to your computer and use it in GitHub Desktop.
templateUrl vs template
angular.module('app')
.component('myComponent', {
templateUrl: 'foo/bar/myComponent.html', // OLD WAY
controller: function(){
//controller code
}
});
angular.module('app')
.component('myComponent', {
template: require('./myComponent.html'), // NEW WAY
controller: function(){
//controller code
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment