question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

attaching dynamic templates to a component

See original GitHub issue

I’m submitting a feature request

Current behavior @Component{ selector:‘selector-name’, templateUrl:‘url to template file’ } Expected behavior We should be able to get the class metadata and should be able to update its templateUrl or any key of annotations.

What is the motivation / use case for changing the behavior? We should be able to dynamically pass the templateUrl and one component can be initialized using different templateUrl. this will help the developer to flexibly use the same component but using some other template.

Please tell us about your environment: Any

  • Angular version: 2.0.X Any

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
trotylcommented, Dec 15, 2016

I think you may be looking for something like NgTemplateOutlet or NgComponentOutlet?

0reactions
angular-automatic-lock-bot[bot]commented, Sep 10, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

typescript - How can I use/create dynamic template to compile ...
here we get a TEMPLATE with dynamic content === TODO var template = this. ... all small parts used for our dynamic Component...
Read more >
Dynamic component loader - Angular
To add the component to the template, you call createComponent() on ViewContainerRef . The createComponent() method returns a reference to the loaded component....
Read more >
Angular Dynamic Templates: How to Build an App With 3 ...
In this post, we'll see how to design & implement an app that supports 3 layout styles using Angular content projection, ngTemplate &...
Read more >
How to render HTML containing Angular Components ...
Attach dynamic template HTML to DOM. It is now time to make the dynamic HTML available in DOM. There are multiple ways to...
Read more >
Angular: Build more dynamic components with ...
ngTemplateOutlet: the template reference (type: TemplateRef ). · ngTemplateOutletContext: A context object to attach to the EmbeddedViewRef.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found