Skip to content

Commit

Permalink
changed data
Browse files Browse the repository at this point in the history
  • Loading branch information
jagadeeshmarthy committed Aug 29, 2017
1 parent 1ca9b58 commit 62c7a5a
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 30 deletions.
14 changes: 7 additions & 7 deletions src/app/app.component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/app.component.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { tasks } from './mock-tasks';
//import { tasks } from './mock-tasks';
import { Task } from './task'
import { Location } from '@angular/common';

Expand All @@ -11,7 +11,7 @@ import { Location } from '@angular/common';
<input [(ngModel)]="task" placeholder="Enter Todo" />
<button (click)="postTask()">Add</button>
<ul>
<li *ngFor="let list of lists">
<li *ngFor="let list of tasks">
<label class="route" >{{list}}&nbsp;<button (click)=deleteTask(list)>x</button> </label>
</li>
</ul>
Expand All @@ -25,17 +25,17 @@ import { Location } from '@angular/common';
// &nbsp;<button (click)=deleteTask(list)>x</button>

export class AppComponent {
tasks: string[] = ['Task1','Task2','Task3','Task4'];
title = 'Angular4';
task:Task;
//task1:Task = ''
lists: Task[] = tasks;
task: string = ''
//lists: Task[] = tasks;
postTask(): void {
this.lists.push(this.task);
this.tasks.push(this.task);
this.task= ' '
}
deleteTask(list: Task): void {
const index = this.lists.indexOf(list);
this.lists.splice(index, 1);
deleteTask(list: string): void {
const index = this.tasks.indexOf(list);
this.tasks.splice(index, 1);
}
}

10 changes: 5 additions & 5 deletions src/app/mock-tasks.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/mock-tasks.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/app/mock-tasks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Task } from './task';
// import { Task } from './task';

export const tasks: Task[] = [
'Task1',
'Task2'
]
// export const tasks: Task[] = [
// 'Task1',
// 'Task2'
// ]
1 change: 1 addition & 0 deletions src/app/task.component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/task.component.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/task.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { tasks } from './mock-tasks';
//import { tasks } from './mock-tasks';

@Component({
selector: 'task-detail',
Expand Down

0 comments on commit 62c7a5a

Please sign in to comment.