How to get component properties from main component in Angular2?

Andrew Blosser

been scratching my head like crazy over this.

Basically all I want is in my index.html something like:

<app hero="iron man"></app>

in my main index.html file, then be able to read the value of hero in my component class.

Been at this for a week, to no avail. Here's my non-functioning plunkr:

http://plnkr.co/edit/FNoNSG0JmBWScSbi4KbT?p=preview

Andrew Blosser

Thanks for your time and response! Unfortunately, in your scenario you're still not retrieving properties of the object, you're just putting a second object inside the first and retrieving those properties.

Good news though for anyone else trying to figure it out, it's confirmed as a bug!

https://github.com/angular/angular/issues/1858#event-305799002

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to get component properties from main component in Angular2?

From Dev

Angular2 - Access component properties from method of properties

From Dev

how to update parent component from child component in angular2

From Dev

Accessing Parent Component Data / Properties from a Child Component in Angular2

From Dev

Angular2/4 Get data from another component

From Dev

angular2 get component css from backend configuration

From Dev

How to get Angular2 to bind component in innerHTML

From Dev

How to get a reference to a particular component in an Angular2 template?

From Dev

How to get the instance of the Kendogrid in angular2 component

From Dev

How to get current component name in Angular2

From Java

Angular2 - how to call component function from outside the app

From Dev

[angular2][ngModules] how to call component from other module?

From Dev

How to get component from component name in codenameone?

From Dev

How to access a child component class from the parent component class in Angular2?

From Dev

how to call a method in one component from another component is angular2

From Dev

Get data passed into Angular2 Component

From Dev

Angular2 Get component reference dynamically

From Dev

How to access component properties from a Java Class

From Dev

How to access component properties from a Java Class

From Dev

Angular 2, component inside main component

From Dev

Angular2 call a Component from a Service

From Dev

calling parent component function from router component in angular2

From Dev

Angular2 - Trying to add a component into a child component from parent

From Dev

Pass a string to component from another component tpl in angular2

From Dev

How to make a container component in Angular2

From Dev

How `angular2` exports a component?

From Dev

How to access the Component on a Angular2 Directive?

From Dev

How to subscribe to a component variable in angular2

From Dev

How to display a component in another component dynmically Angular2

Related Related

  1. 1

    How to get component properties from main component in Angular2?

  2. 2

    Angular2 - Access component properties from method of properties

  3. 3

    how to update parent component from child component in angular2

  4. 4

    Accessing Parent Component Data / Properties from a Child Component in Angular2

  5. 5

    Angular2/4 Get data from another component

  6. 6

    angular2 get component css from backend configuration

  7. 7

    How to get Angular2 to bind component in innerHTML

  8. 8

    How to get a reference to a particular component in an Angular2 template?

  9. 9

    How to get the instance of the Kendogrid in angular2 component

  10. 10

    How to get current component name in Angular2

  11. 11

    Angular2 - how to call component function from outside the app

  12. 12

    [angular2][ngModules] how to call component from other module?

  13. 13

    How to get component from component name in codenameone?

  14. 14

    How to access a child component class from the parent component class in Angular2?

  15. 15

    how to call a method in one component from another component is angular2

  16. 16

    Get data passed into Angular2 Component

  17. 17

    Angular2 Get component reference dynamically

  18. 18

    How to access component properties from a Java Class

  19. 19

    How to access component properties from a Java Class

  20. 20

    Angular 2, component inside main component

  21. 21

    Angular2 call a Component from a Service

  22. 22

    calling parent component function from router component in angular2

  23. 23

    Angular2 - Trying to add a component into a child component from parent

  24. 24

    Pass a string to component from another component tpl in angular2

  25. 25

    How to make a container component in Angular2

  26. 26

    How `angular2` exports a component?

  27. 27

    How to access the Component on a Angular2 Directive?

  28. 28

    How to subscribe to a component variable in angular2

  29. 29

    How to display a component in another component dynmically Angular2

HotTag

Archive