diff --git a/starwars/src/app/search/search.component.html b/starwars/src/app/search/search.component.html index e765724..7b0ffbc 100644 --- a/starwars/src/app/search/search.component.html +++ b/starwars/src/app/search/search.component.html @@ -1,5 +1,6 @@

Search For A Star Wars Character

- + Search String: {{name}} +
diff --git a/use_an_api.md b/use_an_api.md index 28e2662..12ea60f 100644 --- a/use_an_api.md +++ b/use_an_api.md @@ -8,7 +8,7 @@ 1. Add search component to app 1. Add Form HTML to search component 1. Import Form functionality into the app -1. Use ngModel to set a component property to the value of an input +1. Set a component property to the value of an input ## Create a new app @@ -81,4 +81,17 @@ import { FormsModule } from '@angular/forms'; //import FormsModule export class AppModule { } ``` -## Use ngModel to set a component property to the value of an input +## Set a component property to the value of an input + +In `src/app/search/search.component.html`, add `[(ngModel)]` to the text input: + +```html +
+

Search For A Star Wars Character

+ Search String: {{name}} + + +
+``` + +Test this by changing the text in the input field