答案 0 :(得分:1)
includemodal
应该在ModalInstanceController的范围内,因为该模型是在用于模态的模板下定义的。 Updated Plunker
$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: {
}
});
};