I have a component, which writes: Hello Angular6
app.component.html:
<hello name="{{ name }}"></hello>
app.component.ts:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
name = 'Angular 6';
}
Task is, to make a new component, called "Userchange"
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-user-change',
templateUrl: './userchange.component.html',
styleUrls: ['./userchange.component.css']
})
export class UserChangeComponent {
@Input() change: string;
}
There I have a button and a text type input, it should work like that: I write something to the input box, then I press the button, and the 'name'
in the app.component should be the given text.
can you please help me with that?
I just begun learning Angular.