Simple log in


I’m creating a simple app for a Client and they want a section for members only, and rather than connecting to a database to authenticate, they want the user to be able to enter a code in a text box and press the login button to enter.

is there a way to link the text box to the button like you would with an excel ‘if statement’ I was thinking this could be possible with directives.

I’ve seen code on making the button unselectable if no text is entered so hopefully the same idea could work that instead on no text it needs the correct text.

Security isn’t a high priority as there is no commercial sensitive material, they just want to stop he common user from seeing for example a discount code.

Any help or suggestions will be greatly appreciated.

'Login', no authnetication, just stores sessions variables

Sort of figured it out, so thought I post this and hope it helps someone else.

'By using the showContent directive that is explained in the Weekly workshop video ‘toggling content’

I used an input text box and set the directive ng-model: and the value: showContent

and used a button and set the directive ng-show: and the value: showContent==‘test1’ change the text within the ’ ’ to whatever you want the password to be & remove the ’ ’ if you are using a number.

haven’t tested on a device yet so there still maybe the inconvenience of having to enter the password every time , if that happens I’ll work on caching the text and post it.

'Login', no authnetication, just stores sessions variables