RequireJS and AngularJS - angularjs

I'm integrating RequireJS and AngularJS. This is fairly complex problem and I'm struggling to articulate my problem in a Stackoverflow post, so here is a screencast of my issue. Sit back, relax, watch the weirdness..
http://goo.gl/02CGVe
Basically when I load my core dependencies with RequireJS Angular seems to compile the page and then my elements dissapear off the page. I'm at a loss. Any help would be greatly appreciated!
Sidenote: I'm not building a SPA, so there is no need for ngRoute in my case. Here's one of the many tuts that discuss (kinda) what I'm trying to do.

Actually, refer to this Stackoverflow question about an effective way of using AngularJS with RequireJS.
Does AngularJS support AMD like RequireJS?
I saw you video and found some inconsistencies and also, the way you hooked AngularJS with RequireJS is not ideal and kind of confusing. Refer to my post about hooking up both libraries in a consistent and effective way.
http://leog.me/log/large-angularjs-app-components
Hope it helps.

Related

I find that some JS files in the common layout html are not available in the ng-view loaded file

I am new to AngularJS and making a headway.
However I came across this issue later in my work.
I have found that...
Some non-angular JS files are not available in the partial-html loaded with the ng-view command through default AngularJS routing.
As I am new to AJs, so can anyone assist me to fix this problem.
I would really appreciate if the solution is given living in the default AngularJS framework i.e a pure AJs solution. I have seen third party workarounds which are sort of stepping out of the framework without being aware of any possible performance compromises.
Thank you.
After searching for answers for quiet a while I have discovered a pure AngularJS solution to the problem at last.
The solution is rather a complete repository on GitHub by a user so here is the link...
https://github.com/ikaul/AngularJS-Single-Page-App/tree/master/assignment5

How to remove states in ui-router?

I used angularJS 1.5.8 and ui-router 0.3.1 , and in my app I used stateProvider to dynamically create lots of states and I think it's better to delete them to avoid too much memory usage.
I searched a lot, but didn't find the solution. However, it seems that stateRegistry could do this. a link! a link!
I tried to read the source code but sadly can't understand. Wish someone could give me instructions. Thanks.

Is zurb-foundation compatible with Angular JS?

I need to migrate an site from one framework to another because I need to use Angular JS.
I found zurb-foundation very interesting. It happens that it seems to use jQuery.
According to this website https://scotch.io/tutorials/how-to-correctly-use-bootstrapjs-and-angularjs-together
When building out Angular projects, you should not add on the full jQuery library. jQlite is already included in Angular and this should be all the jQuery that is necessary.
I had a bad experience running Bootstrap and Angular together and I don't want to repeat the same mistake.
It happens that I found the following line at zurb-foundation index.html
<script src="js/vendor/jquery.js"></script>
A quick search has shown that it seems to be a "simplified" version of jQuery (am I wrong?).
I've seem many people questioning things related to Angular in Foundation apps.
My question is: Is Angular compatible with Foundation?
While you'll read in many places that you should stay away from jQuery when using Angular, you'll also notice a subtle "at first" here and there. Angular is quite opinionated, and employs a declarative way of doing things, whereas jQuery is imperative. Check this out for more on the topic.
To answer your question:
Scotch.io's tutorial about Angular and Bootstrap involves UI Bootstrap, a library of directives written in Angular to be able to integrate common Bootstrap functionalities easier.
The equivalent of UI Bootstrap for Foundation is Angular Foundation. I recommend giving this thread a look-over as well, as it contains information that may be relevant to your use case.
So yes, Angular is compatible with Foundation. Happy hacking :)
a quick answer is of course they are compitable with each other. check this out from Zurb. However if you do not want to use JQuery, then the easiest way is to use pineconellc for foundation 5. foundation 6 does not have a port yet as far as I know.

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.
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.
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.

backbonejs + angularjs integration

do you have any experience with integrating AngularJS component into existing BackboneJS application?
Could you just briefly give me some help, what should I do to make it work?
Thank you
Igor
I was able to make it work after all
for the future reference - this gist helped me a lot: https://gist.github.com/dgs700/6197687
anyway, Charles is right - it is definitely not nice to combine these two frameworks (in my case, it was not my call to do so...)
Angular scope will overcome the backbone scope. There is no point using those two frameworks on the same project. Mixing those two will result in a poor designed project.
Either stick to Backbone or replace it with Angular.

Resources