0

I was reading a tutorial at https://github.com/angular-ui/ui-router and something caught my attention:

var myApp = angular.module('myApp', ['ui.router']);
// For Component users, it should look like this:
// var myApp = angular.module('myApp', [require('angular-ui-router')]);

What is component users? Why it is written in [require('angular-ui-router')]? It looks like I can dynamically load the plugin this way?

3
  • Before you'll get the answer, you can check these Q & A: stackoverflow.com/q/28188196/1679310 or stackoverflow.com/a/27754025/1679310 (one is html5mode on second off) Commented Jan 29, 2015 at 10:36
  • 1
    @RadimKöhler Thanks for your comment. I have used RequireJS before on my old project build with Jquery. But now, I still don't find a way to get lazy loading work on AngularJS in a clean way. Meaning, without much altering the way writing Angular app to get lazy loading. If it can be done like the above example, it will be great. You know anyhow that can be done? Commented Jan 29, 2015 at 15:05
  • No, sorry, honestly I did not know about that syntax... about that functionality... sorry. Good luck with mighty UI-Router anyhow ;) Commented Jan 29, 2015 at 15:33

1 Answer 1

0

Frontend package management, something that same as bower. I am also no so clear on it, if you are interesting with it, find out more on github.

https://github.com/componentjs/component

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

Comments

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.