-1

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

https://docs.google.com/a/hashtagsell.com/file/d/0B7Ul13wcHjNIT3JXUnlhWW9YSnc/edit?usp=drivesdk

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.

2
  • Ugh, AngularJS and RequireJS... is your SPA still testable after RequireJS? Commented Nov 28, 2014 at 10:32
  • @pixelbits Yes it is Commented Dec 31, 2014 at 1:55

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

3 Comments

That link you posted doesn't answer the question: how can you use RequireJS with AngularJS and still support testing? The answers from the post is saying - Yes its generally possible, with no examples, or backup whatsoever. I've tried - not the easiest thing to do. In the end I got it working, but abandoned it because it was more trouble than it was worth.
I've read your blog post, I'd like to see a section on Testability, and not just theoretical examples. Give it a go and feel the pain:) In my opinion, any AMD framework that limits your ability to test your modules, is not worth it and wasn't meant to be.
@pixelbits Actually, in the example application repo explained in that blog post, you can see a filter unit test on the spec folder (github.com/leog/epsilon/tree/master/spec). It's not difficult once you got the gist of it. I'm currently working on a very big AngularJS application with 1116 unit tests done that way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.