lundi 25 décembre 2017

Laravel Route + Angular 5

I'm building a complex hybrid application with Laravel and Angular wherein I'm trying to bootstrap the Angular 5 application through Laravel route. I don't really want to use Angular's route as I wish to create a separate blades altogether for separate angular module.

Let's assume that, following is the scenario. I've two features:

  1. Receive Client Feedback
  2. Refer your friend

I will be going to create a separate angular module and "blade view" for both these feature:

  • FeedbackModule with FeedbackComponent (app-feedback as selector)
  • ReferFriendModule (app-refer as selector)

Now, I've following requirements:

  • I want to have "app-feedback" and "app-refer" loaded on different blade (two separate bootstraps)

  • I don't want my JS to be filled with unnecessary code e.g. Feedback Page should not have Referral's page JS code (I know we can use Lazy Loading in Angular but it requires "loadChildren" feature of angular. (If there is a way to avoid it (except dynamic component loader) let me know.

Currently, in order to do this, I need to compile my whole code twice. So that, I can get separate JS for refer and feedback module. Is there any easier way to achieve this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire