Created
January 15, 2017 00:22
-
-
Save scionwest/0603d0eff5f1448396169ccdc65bca1d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- navbar --> | |
<nav> | |
<div> | |
<div> | |
<a href="#">Home</a> | |
</div> | |
<ul> | |
<li><a routerLink="/signup">Signup</a></li> | |
</ul> | |
</div> | |
</nav> | |
<!-- SPA content --> | |
<div> | |
<router-outlet></router-outlet> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent { | |
title = 'app works!'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { FormsModule } from '@angular/forms'; | |
import { HttpModule } from '@angular/http'; | |
import { MaterialModule } from '@angular/material'; | |
import 'hammerjs'; | |
import { AppComponent } from './app.component'; | |
import { AppRoutingModule, routingComponents } from './app.routing'; | |
@NgModule({ | |
declarations: [AppComponent, routingComponents], | |
imports: [ | |
BrowserModule, | |
FormsModule, | |
HttpModule, | |
AppRoutingModule | |
], | |
providers: [], | |
bootstrap: [AppComponent] | |
}) | |
export class AppModule { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule } from '@angular/core'; | |
import { RouterModule, Routes } from '@angular/router'; | |
import { SignupComponent } from './signup/signup.component'; | |
const appRoutes: Routes = [ | |
{ path: 'signup', component: SignupComponent }, | |
{ path: '', pathMatch: 'full', redirectTo: 'signup' } | |
]; | |
@NgModule({ | |
imports: [RouterModule.forRoot(appRoutes)], | |
exports: [RouterModule], | |
}) | |
export class AppRoutingModule { } | |
export const routingComponents = [SignupComponent]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form role="form" #form="form" (ng-submit)="submit(form.value)"> | |
{{diagnostic}} | |
<fieldset> | |
<legend>Create Account</legend> | |
<label><strong>Email:</strong></label> | |
<input name="Email" [(ng-model)]="user.email" required type="email" placeholder="Enter your email address" /> | |
<label><strong>Password:</strong></label> | |
<input name="password" [(ng-model)]="user.password" required type="password" /> | |
<div> | |
<button type="submit">Create</button> | |
<button>Cancel</button> | |
</div> | |
</fieldset> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
@Component({ | |
selector: 'app-signup', | |
templateUrl: './signup.component.html', | |
styleUrls: ['./signup.component.css'] | |
}) | |
export class SignupComponent implements OnInit { | |
constructor() { } | |
ngOnInit() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment