ChaiNavawongse
ChaiNavawongse

Reputation: 199

AngularJS with Durandal?

Is it possible to run AngularJS in a Durandal project? We are using Durandal now but want to move to AngularJS while still keep the site operational. Is it even a good idea to attempt this?

Any suggestion would be greatly appreciated.

Upvotes: 0

Views: 358

Answers (2)

PW Kad
PW Kad

Reputation: 14995

The other answer isn't exactly correct. I have an example that proves it wrong.

Durandal is a module loader that can load any view / view model pair. If you choose to load an angular application and leave out the router portion it works just fine. It really isn't that difficult to get it set up.

Wrap your Angular.js application initialization code in an AMD module (view model) with a matching view and it just works.

Upvotes: 1

Jordan Marr
Jordan Marr

Reputation: 107

You could run them side-by-side, but then you would just have two separate SPAs hosted on the same site. The doesn't seem like a good upgrade strategy to me. I think you would be better off to fully develop the new version and then replace the site altogether.

I would also advise that you wait for the release of AngularJS 2.0 (if possible). Rob Eisenberg has announced that he is currently working with the AngularJS team to provide core changes and plugins that will make Angular 2.0 more familiar to developers with Durandal experience, as well as to provide a migration path from Durandal to Angular 2.0.

Upvotes: 1

Related Questions