Resolve function not working in Angularjs $dialogue service -
folks using ui.bootstrap.dialog server open modal window data in it. in order create modal window have following code:
$scope.data = {"one" : "a","two" : "b"}; $scope.viewopts = { backdrop: true, keyboard: true, backdropclick: false, templateurl: 'templates/view-add-dialogue.tpl.html', controller: 'viewadddialogcontroller', resolve: { user: function(){ return $scope.data; } } }; $scope.addcustomview = function() { console.log("addcustomview"); var d = $dialog.dialog($scope.viewopts); d.open(); };
later on have defined controller below:
function veiwadddialogcontroller($scope,dialog,user){ console.log(user); $scope.close = function(result){ dialog.close(result); }; }
however "user" object gets passed controller not have data instead prints following console:
function (){ return $scope.data; }
what missing here ?
ok .. using following did trick:
resolve: { headerlist: $scope.headers }
thanks replied.
Comments
Post a Comment