We are trying to create a portal type application with multiple / independent "sub-apps". Assuming that all sub-apps are written in Angular what is a good pattern to achieve the following goals.
Given the fact that AngularJs does not have multi-level view structure, I was thinking of using multiple ng-app declarations on different divs and then using $window scope to store the key of the active app and hide the ones which are not active.
How to Develop a Single Page Application Using AngularJS? Step 1: Create a Module. We all know that AngularJS follows MVC architecture. Hence, every AngularJS application contains a module comprising of ... Step 2: Define a Simple Controller app.controller ('FirstController', function ($scope) { ...
Angular 9, Angular 10 , Angular 11 There are several advantages of having Multiple Angular Apps in One Project. One is you do not have to run the time consuming npm install for every app. The node_modules folder is shared with all the other apps saving disk space. All the apps can be updated to the next version easily.
A single source-control repository (such as git ). We create a new app using the ng new <new> Angular CLI command. It creates and workspace with an initial Angular app with the name <new> in the src folder. The createApplication="false" option introduced in Angular 7 now stops the creation of the initial app. It only creates the workspace
The Angular CLI since version 6 allows us to create a multi-project workspace to manage multiple Angular apps. We do that first by creating an empty workspace. A Workspace is a collection of Angular apps, projects, or libraries. Later we can add multiple projects to the workspace. Applies to: Angular 6 to the latest edition i.e. Angular 8.
There is no easy answer to your (rather open) question, but regarding the $route and ngView limitations, I have been having great success employing a technique derived from this: http://www.bennadel.com/blog/2420-Mapping-AngularJS-Routes-Onto-URL-Parameters-And-Client-Side-Events.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With