angularjs - ngdialog template is being opened -
i using plain ng-dialog showing popup in mvc4 application along angular. here code
var myapp = angular.module('myapp', [ 'ngsanitize', 'jsondatefilters', 'timer', 'ngdialog']); myapp.config(function ($provide, $controllerprovider, compileprovider, ngdialogprovider) { myapp.controllerprovider = $controllerprovider; myapp.compileprovider = $compileprovider; ngdialogprovider.setdefaults({ classname: 'ngdialog-theme-default', plain: false, showclose: true, closebydocument: true, closebyescape: true, appendto: false, preclosecallback: function () { console.log('default pre-close callback'); } });
i trying open pop given below
$scope.showalertdetails = function () { ngdialog.open({ template: 'firstdialogid', controller: 'alerteditctrl', classname: 'ngdialog-theme-default', scope: $scope, // line wasn't here before closebydocument: false }); }
my template
<script type="text/ng-template" id="firstdialogid" > <div class="ngdialog-message"> <h3>ngdialog template</h3> </div> <div class="ngdialog-buttons"> <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="opensecond()">open next</button> </div> </script>
i refering http://ngmodules.org/modules/ngdialog
angularjs not showing pop predefined script template, rather taking template id action in mvc4.
i found root cause, template not written in controller. that's causing problem.
Comments
Post a Comment