我試圖創建類似於角度2的門戶功能,它將提供基本導航和全局服務(如身份驗證),但允許其他開發人員創建自己的模塊,這些模塊從根本上插入門戶。Angular 2 - 將模塊移動到他們自己的項目
我正在使用angular-cli,並且已經通過路由器(使用loadChildren)在app.module中延遲加載,在項目內部創建了模塊(請參閱樹),對模塊進行了快速驗證。每個子模塊都有自己的路由器,並從父門戶(app.module)中根本解耦。
我最終希望將這些子模塊移動到他們自己的項目中,但完全不知道從哪裏開始,並且似乎很少有關於此在線的信息。如果有人知道一個例子,或者可以演示如何設置,我會非常感激。
編輯:我想繼續使用Angular-CLI功能來做到這一點,如果可能的話。
這是我的目錄結構。 Module 1,2 & 3需要遷入自己的項目。
+-- app
│ +-- app.component.css
│ +-- app.component.html
│ +-- app.component.spec.ts
│ +-- app.component.ts
│ +-- app.module.ts
│ +-- module1
│ │ +-- dataflows
│ │ │ +-- dataflows.component.css
│ │ │ +-- dataflows.component.html
│ │ │ \-- dataflows.component.ts
│ │ +-- module1.component.css
│ │ +-- module1.component.html
│ │ +-- module1.component.ts
│ │ +-- module1.module.ts
│ │ \-- other
│ │ +-- other.component.css
│ │ +-- other.component.html
│ │ \-- other.component.ts
│ +-- index.ts
│ +-- module2
│ │ +-- module2.component.css
│ │ +-- module2.component.html
│ │ +-- module2.component.ts
│ │ \-- module2.module.ts
│ \-- module3
│ +-- dummy1
│ │ +-- dummy1.component.css
│ │ +-- dummy1.component.html
│ │ \-- dummy1.component.ts
│ +-- module3.component.css
│ +-- module3.component.html
│ +-- module3.component.ts
│ +-- module3.module.ts
│ \-- dummy2
│ +-- dummy2.component.css
│ +-- dummy2.component.html
│ \-- dummy2.component.ts
+-- index.html