Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {Component, View, Injectable, CORE_DIRECTIVES, FORM_DIRECTIVES} from 'angular2/angular2';
- import {AuthService} from '../../authService';
- @Injectable()
- class User{
- email:string;
- password: string;
- }
- @Component({
- selector: 'Login',
- })
- @View({
- templateUrl: '/src/app/components/login/login.html',
- directives: [CORE_DIRECTIVES, FORM_DIRECTIVES],
- })
- @Injectable()
- export class Login {
- authService:AuthService;
- user: User;
- constructor(authService: AuthService, user: User){
- this.authService = authService;
- this.user = user;
- }
- login = () => {
- console.log("login");
- }
- }
- enter code here
- <section class="container centered">
- <div class="row">
- <div class="well bs-component col-xs-12 col-xs-offset-0 col-sm-12 col-sm-offset-0 col-md-6 col-md-offset-3 col-lg-offset-4 col-lg-4">
- <h3>Log In</h3>
- <form class="padding-top-20" role="form" novalidate>
- <div class="form-group">
- <input class="form-control" type="text" name="email" id="email" placeholder="Email Address" [(ng-model)]="user.userName" required autofocus />
- </div>
- <div class="form-group">
- <input class="form-control" type="password" name="password" id="password" placeholder="Password" [(ng-model)]="user.password" required autofocus />
- </div>
- <button class="btn btn-primary btn-wide" type="submit" (click)="login()">Log In</button>
- <div class="padding-top-20 padding-bottom-20">
- <a href="/forgotpassword" title="Forgot Password?">Forgot Password?</a>
- </div>
- </form>
- </div>
- </div>
- </section>
- @Component({
- selector: 'Login',
- providers: [Login, User]
- })
Add Comment
Please, Sign In to add comment