Angularjs Watch表达式在包含的模式中不起作用
我只想将work作为一个watch表达式转换成一个模态,它包含在一个html文件中 在我的演示中,有两块手表:一块可以工作,另一块不行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({
谢谢
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: {
}
});
};