1
   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と同じ値を自動的に持つべきですか?

4

1 に答える 1