M
M
Mikhail Moskalev2014-04-08 16:18:13
Angular
Mikhail Moskalev, 2014-04-08 16:18:13

How to use nested angularjs controllers?

Good afternoon!
I'm writing a one-pager in angularjs, but due to the huge number of pages with a lot of nesting, I get huge controller names for each specific page (userAccauntAddPageCtrl for example).
Is it possible somehow to avoid similar controller names and use nested controllers, user.account.add for example?
Or maybe there is a better approach to attaching controllers to a page?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-04-08
Protko @Fesor

They're also not that long names... so don't worry.

R
Roman Melnikov, 2014-04-11
@Neftedollar

https://github.com/angular-ui/ui-router it is best to bind controllers to the page using ui-router moreover, there you can really use the name like this 'index.user.profile' in theory it should be a nested controller in the user controller which is nested in index which is global. Although this is not required.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question