angular.js - Using the routing call interface of angularjs, it can be called from the controller, but the data cannot be obtained on the page.
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-15 17:05:42
0
2
527

My routing code

The called html interface is marked in red and the controller has been obtained again. When it is obtained on the html, there is no problem and the data can be displayed normally. After deleting the controller, the data cannot be obtained on the page, but my The controller can also load data normally

The following is my controller code

I now want to call the controller directly on the route instead of adding it to the html page. Is there any solution?

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(2)
迷茫

LZ You should read the usage of Controller and Controller AS in the AngularJS documentation~

巴扎黑

state is configured as:

{
    controller: '****Controller',
    controllerAs: 'vm'
}

Then delete ng-controller in your html.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template