0

Is it a good practice to have one controller, but two different html file templates that shows same data but in different format.

Basically I need slightly different template to present the view on a modal dialog and different template to show when it is called on a web page. Any suggestions, advice is appreciated.

Thanks!!

1 Answer 1

2

It is totally fine to share one controller between multiple views. In fact this in one of the strengths of decoupling the javascript from the view like Angular code helps you do. Different views can share the same logic but still render different markup.

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

Comments

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.