What are the differences in angular controller notation?

前端 未结 1 384
难免孤独
难免孤独 2021-01-22 19:09

I\'ve have seen a couple of notations to initialize a controller in angular, those are:

app.controller(\'nameCtrl\', function($scope, ... ){})

1条回答
  •  面向向阳花
    2021-01-22 19:50

    app.controller('nameCtrl', function($scope, ... ){})
    

    The above won't work with minification, but the below will.

    app.controller('nameCtrl', ['$scope','...',function($scope,...){}])
    

    0 讨论(0)
提交回复
热议问题