Last active
April 29, 2017 19:01
-
-
Save aaronfrost/5b9a7d7cec01a695d6b78e83c0e86c5a to your computer and use it in GitHub Desktop.
templateUrl vs template
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('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