shivani
shivani

Reputation: 1028

Render partial view in angular JS

Is there any way to create a partial view like .net MVC in angular JS. I'd like to achieve the same partial view functionality in angular JS.

For Ex. I want to reuse a modal popup in all page so I don't have to write the same code on each page.

Upvotes: 0

Views: 1361

Answers (2)

Exlord
Exlord

Reputation: 5391

you can use ng-include for partials, but if you are going to use this partial inside a ng-repeat its best to use a directive instead.It has better performance.

Upvotes: 1

p0stm
p0stm

Reputation: 93

From this question it is hard to judge what you want to achieve, but from angulars perspective you can always use ng-include to include template fragments.

I'd recommend to either provide a more detailed example - potentially with code example - so that you get better support. If you want to create something that is a partial in an MVC framework, then I'd say that should be a component/directive in angular.

Upvotes: 0

Related Questions