here trying achieve: have topnav login button. when login button clicked, want display login popup dialog.
similarly, pages have giant "register" button. want login popup appear when button clicked.
in order both topnav , other (outside) components display login popup, recommend create service login popup (see previous question: (separate controller directive?)
my question is: can please outline steps need take in order create service? i'm having bit of trouble, after reading documentation.
here's have far:
angular.module('myapp') .factory('login', loginservice); function loginservice() { return { showloginpopup: function () { // need show login popup here } } }
is correct far? define html login popup? use templateurl attribute? there recommended approach?
thanks
edit
for sake of example, let's assume template simple
<div class="login-popup"> <input type="text" id="username" /> <input type="text" id="password" /> <button>submit</button> </div>
i assume i'll need ng-show attribute. should linked to? typically, link property of controller... since initiated service, there no controller object it. missing?
Comments
Post a Comment