AngularJS and modulation

AngularJs gives you the ability to create modules. Everything is fine. It also gives you the ability to add components to your modules, such as service, controlleretc.

My only problem is that no matter which module you defined the component in, you can completely overwrite it from another module.

Examples:

app.module('aModule').controller('SimpleController', functino(){...});
app.module('bModule').controller('SimpleController', functino(){...});

If you try to determine let say state determination with ui-router, it just won't work, as one controller will completely overwrite the one that was loaded first.

Have you met this problem too or is it just me?

+4
source share
1 answer

, . "component.controller" ( , ), , Angular 1

+2

Source: https://habr.com/ru/post/1623395/


All Articles