Reputation: 3031
I started learning angularJS2 for my Social project. It is huge project and the app requires different activities at different stages and also a one page app. I doesn't want to load all dependencies at first time. My first screen will be login/signup after going threw these there will be screens according user's personalization which requires different dependencies. So basically how to achieve this, is my question.
Upvotes: 0
Views: 544
Reputation: 657338
Angular is working on a build tool that results in the app only loading the components that are required for a specific route. You won't have to do anything to get this feature except using the router.
Upvotes: 2
Reputation: 275867
So basically how to achieve this
You are looking for lazy loading.
This is a topic covered well here : http://blog.mgechev.com/2015/09/30/lazy-loading-components-routes-services-router-angular-2/
Upvotes: 3