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?

user1995781
  • 19,085
  • 45
  • 135
  • 236
  • Before you'll get the answer, you can check these Q & A: http://stackoverflow.com/q/28188196/1679310 or http://stackoverflow.com/a/27754025/1679310 (one is html5mode on second off) – Radim Köhler Jan 29 '15 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? – user1995781 Jan 29 '15 at 15:05
  • No, sorry, honestly I did not know about that syntax... about that functionality... sorry. Good luck with mighty UI-Router anyhow ;) – Radim Köhler Jan 29 '15 at 15:33

1 Answers1

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

edisonthk
  • 1,403
  • 16
  • 35