0

I've been reading alot about the route provider and how you can load different templates by specifying the url path.

Is there a way where instead of providing a path to template, we could programatically generate a view on the fly and attach it to the controller?

2
  • you can create an angular directive and make the changes dynamically Commented Dec 18, 2014 at 6:04
  • any resource where I could get some more insight? Commented Dec 18, 2014 at 6:08

1 Answer 1

1

you can dynamically create a template in a directive using $compile.

here's another example: http://onehungrymind.com/angularjs-dynamic-templates/.

I'm not sure how you do that using just the router though. I think you need to add more context to you're question.

Sign up to request clarification or add additional context in comments.

1 Comment

Haha I just landed on that article 5 mins back! But hey .. Thanks a ton :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.