angularjs - $materialDialog fails to show when used with angular-ui-router -
I have a sample plank
I have a login page and on a successful login, Redirected to the home page, which is similar to:
$ state.go ('home'); Now, after logging in, I have a button to show some dialogs, failing to load the dialog by clicking the button. If the user refreshes the home page (click login) and then clicks on the button, then the dialog opens successfully, I do not understand why this is why it may be due to a bug in the angular-u-router is? Or am I missing something?
I believe you did this wrong, when Uri router should use it Let me control your states I'm not sure why to show your dialogue, but I think that you are using ng-click to open it ui-sref will be a better way to create a button that maps to a sub-state. & lt; Md-button ui-sref = "characters.create" / & gt; Then define a onEnter instead of a controller in your state definition. .state ('characters.create', {Url: '/ create', templateURL: 'character / created html', but: function ($ mdDialog, $ log, $ state) { Var ev = null; // This $ event should be $ mdDialog.show ($ MdDialog.alert () .Parent (angular.element (document.body).) Title ('This is a warning title'). Content (' You can specify some details text here.) .ariaLabel ('Warning Interaction Demo') .Ok ('Understand it!'). TargetEvent (ev)) Then (function (answer) {$ log.debug (' Answer ', reply); $ state.go (' character ');}, function () {$ log.debug (' canceled communication ');}}}
Comments
Post a Comment