---
layout: post_en
title: angularjs+requirejs
description: improve haxejs-angular module management by requirejs
date: "2014-12-27 11:00:00 +0800"
author: kmshi
categories: [en]
keywords: haxe, javascript, js, html5, angular, cordova, openfl, nodejs
---

#The problems of current haxejs-angular?
haxejs-angular can help you manage js library dependencies automatically in 2 ways:
- copy the js library files you need to www/bower_components folder,so you can reference them in html by script tags.
- compile code with all libraries you need into a single file by using embed_js flag

It is a pity that the embed way does not work all the time, some libraries can not be embeded into wrapped function generated by haxejs, like latest jquery and ionic. We need a better way to improve it.

#It is [requirejs](http://www.requirejs.org/)!
In node env, we like its module dependencies system: require("module name").
Is it possible to do same in browser env? Yes, [requirejs](http://www.requirejs.org/) comes to save world!
And some smart guys had already experiment a lot:
- blog:http://www.startersquad.com/blog/angularjs-requirejs/
- example:https://github.com/StarterSquad/ngseed

#ToDo
- improve haxejs libraries
- change haxejs.github.io and other showcase apps


Add a blog for requirejs+angularjs
Add a blog for requirejs+angularjs
