This file contains 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
ng generate service TodoData |
This file contains 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
h1 { | |
text-align: center; | |
} | |
.example-full-width { | |
width: 100%; | |
} |
This file contains 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
<app-todo-add></app-todo-add> |
This file contains 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'; | |
import { TodoItem } from '../todo-item'; | |
@Component({ | |
selector: 'app-todo-add', | |
templateUrl: './todo-add.component.html', | |
styleUrls: ['./todo-add.component.css'] | |
}) | |
export class TodoAddComponent { |
This file contains 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 {MatInputModule} from '@angular/material'; | |
@NgModule({ | |
... | |
imports: [MatInputModule], | |
... | |
}) |
This file contains 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
export class TodoItem { | |
id: number; | |
name: string; | |
isComplete: boolean; | |
constructor(values: Object = {}) { | |
Object.assign(this, values); | |
} | |
} |
This file contains 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
<h1>Todos</h1> | |
<mat-form-field class="example-full-width"> | |
<input matInput placeholder="What needs to be done?" autofocus="" | |
[(ngModel)]="newTodo.name" (keyup.enter)="onAddTodo()"> | |
</mat-form-field> |
This file contains 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
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> |
This file contains 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 "~@angular/material/prebuilt-themes/indigo-pink.css"; |
This file contains 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 {BrowserAnimationsModule} from '@angular/platform-browser/animations'; | |
@NgModule({ | |
... | |
imports: [BrowserAnimationsModule], | |
... | |
}) |
NewerOlder