angularjs - Angular Modal Scope Value Not Setting -
i using angular bootstrap ui , using modal. have variable in main controller instantiated on controller load.
$scope.links = { imagesa: "" };
this variable not set value 'wept' after close modal.
any ideas issue here?
here function open modal dialog
$scope.instagrammodal = function (size) { var modalinstance = $modal.open({ templateurl: 'instagrammodal.html', controller: 'instagrammodalinstancectrl', size: size, resolve: { items: function () { return $sails.get("/instagram/self").success(function (response) { return response.data; }).error(function (response) { console.log('error'); }); } } }); modalinstance.result.then(function (selecteditem) { $scope.links.imagesa = 'wept'; }, function () { $log.info('modal dismissed at: ' + new date()); }); };
this modaldialog controller
.controller('instagrammodalinstancectrl', function ($scope, $modalinstance,items) { $scope.instapics = json.parse(items.data); $scope.selectig = function(index) { $modalinstance.close($scope.instapics.data[index]); } $scope.cancel = function () { $modalinstance.dismiss('cancel'); }; });
how closing modal?
you have close modal .close()
, not dismiss()
$modalinstance.close();
Comments
Post a Comment