0

I need to add new features to an already existing application. The application is built using Lithium and jQuery. The features that needs to be included have a complex view which allow users to analyze data and perform CRUD functionality. I won't go into details about the features here, but after working on a few simple Angular tutorials and side projects, I know that using AngularJS to create this view will make my life a lot more easier than creating the view using jQuery.

Over the course of the next few months we may convert the entire app to AngularJS.

I am uncertain about where I should place the Angular files and how to setup routing. How can I integrate AngularJS to Lithium so that part of the Lithium routing works and part of it is handled by AngularJS.

I also found this answer on stackoverflow but it doesn't mention folder structures or how to integrate Angular with Lithium. I think this link mentioned in the answers is supposed to have what I am looking for but it doesn't seem to exist anymore.

Community
  • 1
  • 1
ysfiqbl
  • 396
  • 3
  • 17

1 Answers1

1

The link is down, but you can clone the source repository and run it yourself here: https://github.com/nateabele/li3-angular-presentation

Regarding organization, the simplest way would be to place the directory structure for your Angular components inside of /webroot. The more advanced (and in my opinion better) way would be to make them two separate applications: an AngularJS UI app, and a backend API in Li3 that it talks to.

Nate Abele
  • 5,771
  • 32
  • 27
  • Thanks Nate. Maybe I am missing something, I thought the simplest and easiest way would be to have them as two separate applications. For example, if my Li3 app lives in `/var/www/my_app/web/`, I could add my AngularJS UI app as a separate application to `/var/www/my_app/angular/` and the URLs in my AngularJS AJAX calls would be be something like `../web/path/to/resource/` right? – ysfiqbl May 31 '14 at 03:19
  • Yup, two separate applications is normally what I recommend, however, that comes with some deployment overhead. Anyway, yeah, that sounds about right. – Nate Abele Jun 02 '14 at 11:23