angular2-decorators Questions

2

Solved

Why in components or directives do the metadata or decorators have the @ symbol (e.g. @Component, @Directive)? What is the purpose of it, and when should I use it?
Inmate asked 24/2, 2017 at 5:20

4

Solved

I'm trying to figure out how I can access the selector that we pass into the @Component decorator. For example @Component({ selector: 'my-component' }) class MyComponent { constructor() { // I w...

5

Solved

I am new to angular and I have the following situation which is I have a service getAnswers():Observable<AnswerBase<any>[]>and two components that are related to each other. online-qu...

0

I want to use captured phase of @HostListener. @HostListener('document:keydown.escape', ['$event']) onKeydownHandler(event: KeyboardEvent) { console.log("key pressed"); } Above code use defaul...
Assessment asked 14/12, 2018 at 9:13

1

Solved

I am new to learn Angular. I was learning about angular's decorators on angular.io. There is not much information about the @Attribute decorator. Please anyone give me some use cases.
Gushy asked 1/1, 2018 at 7:0

1

Solved

Is it possible to get component class name or component reference using selector name in Angular 2? @Component({ selector: 'selector-1', template: '<h1>Hello</h1>', }) export class C...

1

Solved

An Angular component has decorators: @Component({ ... }) export class MyAngularComponent { @Input() myInputParam: MyType; @Input() myOtherInputParam: MyOtherType; @Output() myOutputParam: MyOth...

1

From official docs we know that Component decorator allows you to mark a class as an Angular component and provide additional metadata that determines how the component should be processed, inst...
Howl asked 5/12, 2016 at 21:42
1

© 2022 - 2024 — McMap. All rights reserved.