i seached a lot about this problem and i didn't found a real good solution. I have two components and i want to pass a variable from the first component to the seconde. This variable will be the templateUrl of the second Component. I found some answers using factories and stuf like this but no one gave me the solution. Is there any solution? thank you
Asked
Active
Viewed 3,434 times
2
-
I believe that what you are looking for are [@Input](http://learnangular2.com/inputs/)s – silentw Apr 13 '17 at 15:34
-
Thank you for your answers. Can you explain more please? – Amir Nadji Apr 13 '17 at 15:36
-
How are you passing the variable? Via query params? Or any other way? – silentw Apr 13 '17 at 15:38
-
http://stackoverflow.com/questions/31692416/dynamic-template-urls-in-angular-2#34067211 – elpddev Apr 13 '17 at 15:39
-
Possible duplicate of [How to use variable to define templateUrl in Angular2](http://stackoverflow.com/questions/39410355/how-to-use-variable-to-define-templateurl-in-angular2) – silentw Apr 13 '17 at 15:39
-
the second component is called by the first with his tag in the template. my first idea to pass the variable is data binding i think – Amir Nadji Apr 13 '17 at 15:40