Error: [ng:areq] from angular controller

后端 未结 20 2185
攒了一身酷
攒了一身酷 2020-11-27 17:39

This is a long shot, but has anyone seen this error before? I am trying to add \'Transporters\' using express, angular and mongoDB. I get this error whenever I access a page

20条回答
  •  天涯浪人
    2020-11-27 18:26

    I have made a stupid mistake and wasted lot of time so adding this answer over here so that it helps someone

    I was incorrectly adding the $scope variable(dependency)(was adding it without single quotes)

    for example what i was doing was something like this

    angular.module("myApp",[]).controller('akshay',[$scope,
    

    where the desired syntax is like this

    angular.module("myApp",[]).controller('akshay',['$scope',
    

提交回复
热议问题