The main moduleapp.js:
angular.module("myApp",["phoneList"]);
and I follow the tutorial to make a sperate component module named phoneList
angular.module("phoneList")
//^ omit the empty bracket here, cause no dependency needed
.component('phoneList', {
templateUrl: 'template/phone-list.html',
controller: function (){
this.phones = [
{name: "iphone", snippet: "designed by apple"},
{name: "nexus", snippet: "phone that could explode"}
]}
});
but it will complain that:
angular.min.js:6 Uncaught Error: [$injector:nomod] http://errors.angularjs.org/1.6.1/$injector/nomod?p0=phoneList
at angular.min.js:6
at angular.min.js:25
at b (angular.min.js:24)
at Object.module (angular.min.js:25)
at phone-list.js:5
When I add an empty [] back:
angular.module("phoneList",[])
.component(//balabla)
things will work just fine. I checked the API Reference, it demonstrate that the dependency is optional thus could be omitted.

angular.Module, whereas passing more than one argument creates a newangular.Moduleas you are creatingphoneLista new module so you have to pass 2nd parameter