L
L
liltrill2019-10-06 19:18:10
Angular
liltrill, 2019-10-06 19:18:10

How to get component attribute?

I have a component:

@Component({
  selector: 'app-icon',
  templateUrl: './icon.component.html',
  styleUrls: ['./icon.component.less']
})

How can I get this value in the class constructor:
<icon name="Нужное значение"></icon>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2019-10-06
@liltrill

this is not possible in the constructor, at this stage the view of the component has not yet been created.
And so this is a normal Input

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question