preboot / angularjs-webpack

A complete, yet simple, starter for AngularJS using webpack
MIT License
1.71k stars 658 forks source link

When to use `templateUrl` vs `template: require('./app.html')`? #89

Closed ugultopu closed 7 years ago

ugultopu commented 7 years ago

In app.js, the template is referenced as follows:

template: require('./app.html')

However, AngularJS has a templateUrl option as well and it could have been written as following as well:

templateUrl: './app.html'

What would be the differences between these two approaches?

phra commented 7 years ago

i think there were differences in the past. right now the suggested way is to use the @angular/cli. have a look here.