AngularJS error: 'argument 'FirstCtrl' is not a function, got undefined'

前端 未结 16 1194
时光取名叫无心
时光取名叫无心 2020-12-01 05:55

I noticed the same question was asked a few times here, I tried so solve it but nothing helps.

I\'m following this tutorial with the egghead videos.

But whe

16条回答
  •  攒了一身酷
    2020-12-01 06:36

    Firstly - If the module name is not defined, in the JS you will not be able to access the module and link the controller to it.

    You need to provide the module name to angular module. there is a difference in using defining module as well 1. angular.module("firstModule",[]) 2. angular.module("firstModule")

    1 - one is to declare the new module "firstModule" with no dependency added in second arguments. 2 - This is to use the "firstModule" which is initialized somewhere else and you're using trying to get the initialized module and make modification to it.

提交回复
热议问题