Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs Watch表达式在包含的模式中不起作用_Angularjs_Modal Dialog_Angularjs Scope_Watch_Angularjs Ng Include - Fatal编程技术网

Angularjs Watch表达式在包含的模式中不起作用

Angularjs Watch表达式在包含的模式中不起作用,angularjs,modal-dialog,angularjs-scope,watch,angularjs-ng-include,Angularjs,Modal Dialog,Angularjs Scope,Watch,Angularjs Ng Include,我只想将work作为一个watch表达式转换成一个模态,它包含在一个html文件中 在我的演示中,有两块手表:一块可以工作,另一块不行 谢谢includemodal应在ModalInstanceController的范围内,因为该模型在用于模态的模板下定义 我得到“导入错误-未找到Plunk” $scope.openAddProductModal = function ( ) { var modalInstance = $modal.open({

我只想将work作为一个watch表达式转换成一个模态,它包含在一个html文件中

在我的演示中,有两块手表:一块可以工作,另一块不行


谢谢

includemodal
应在ModalInstanceController的范围内,因为该模型在用于模态的模板下定义

我得到“导入错误-未找到Plunk”
$scope.openAddProductModal = function ( ) {   
      var modalInstance = $modal.open({
              templateUrl: 'AddProductModalContent.html',
              controller:  function ($scope, $modalInstance, $log) {
                $scope.includemodal={search_value:''};

                $scope.$watch('includemodal.search_value', function(new_val) {
                  console.log('includemodal.search_value ' + new_val);
                });

               $scope.ok = function () {
                $modalInstance.close();
               };

              $scope.cancel = function () {
                $modalInstance.dismiss('cancel');
              };
           },
            resolve: {

            }
          });
  };