var myappWebApp = angular.module('myappWebApp', ['ui.bootstrap']);
//工厂
myappWebApp.factory('wired', function () {
this.currOp = false;
return {
currOp1 : this.currOp
}
});
// controller
myappWebApp.controller('wiredCtrl',
function ($scope, $http, wired) {
//data
$scope.currOp = wired.currOp;//why is this undefined?
$scope.currOpInText = wired.currOpInText();
$scope.altOpInText = null;
$scope.boxA = null;
....
我的 scope.currOp 应该如何始终自动具有与wired.currOp 相同的值?