File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,11 @@ <h3>TodoState</h3>
1717 < input
1818 #text
1919 placeholder ="New Todo "
20- (keydown.enter) ="todo.addTodo(text.value) "
20+ (keydown.enter) ="todo.addTodo(text.value); text.value = '' "
2121 />
2222 < button
2323 type ="button "
24- (click) ="todo.addTodo(text.value) "
24+ (click) ="todo.addTodo(text.value); text.value = '' "
2525 >
2626 Add
2727 </ button >
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ export class UserService {
1414 private readonly SIMULATE_REQUEST_DELAY : number = 2000 ;
1515
1616 public loadUser ( ) : Observable < UserModel > {
17- return this . httpService . get < { data : UserModel } > ( '/assets/user.json' ) . pipe (
17+ const path = location . pathname ;
18+
19+ return this . httpService . get < { data : UserModel } > ( `${ path } assets/user.json` ) . pipe (
1820 delay ( this . SIMULATE_REQUEST_DELAY ) ,
1921 map ( ( response : { data : UserModel } ) : UserModel => response . data ) ,
2022 ) ;
You can’t perform that action at this time.
0 commit comments