如何在不使用$scope
的情况下从子ctrl中更改父crtl中的对象?
示例:
myApp.controller("ParentController", function () {
var pvm = this;
pvm.index = 0;
});
myApp.controller("ChildController", function () {
var cvm = this;
pvm.index = 1; // how to achieve this?
});