dialog - Angularjs Add Data to templateCache -
i having problems showing data in templatecache...
if "edit" button clicked, custom dialog showing , userdata supposed show in input fields edited.
i used data sql select , worked fine , have saved data in $cookiestorage , wanted take information $cookiestorage , add dialoge.
the function supposed be, dialog showing when function completly done! need loaded , put data fields.
thats code:
var listapp = angular.module('listpp', ['ui.bootstrap','dialogs','ngcookies']); listapp.controller('userctrl', function ($scope, $dialogs,$cookiestore) { .... $scope.u_edit = function (index) { dlg = $dialogs.create('/dialogs/edituser.html','edituserctrl',{},{key:false ,back:'static'}); $cookiestore.aktuser = $cookiestore.user[index-1]; -stuff user infos , react button clicks in dialog- }) .run(['$templatecache',function($templatecache,$scope,$cookiestore){ $templatecache.put('/dialogs/edituser.html', .... +'<input type="text" name="userid" id="userid" ng-model="user.id">' +'<input type="text" name="username" id="username" ng-model="user.name">' .... }]);
the problem is, can't fill fields when dialog isn't loaded, dont know how to catch info, dialog loaded fill fileds data.
there method angular-dialog-service called opened, still happening before dialoge loaded....
...so how data in dialog??
in case cares:
i saved needed data in cookiestore, in customdialog controller templatecache saved data in $scope , used in template , when click save button save new data in $cookiestore again!!
Comments
Post a Comment