1.0.2 • Published 10 years ago

ngbuild v1.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
10 years ago

NGBUILD

NGBUILD is lightweight tool for build your Angular.js app on the fly. Example project - https://github.com/galkinrost/angular-super-seed

Installation

For using from the comman-line install the package globally

npm install -g ngbuild

For using in the project

npm install --save ngbuild

Plugins

Grunt - https://github.com/galkinrost/grunt-ngbuild Gulp - https://github.com/galkinrost/gulp-ngbuild

Example

/app.js

angular.module('App',['controllers.js']);

/controllers.js

angular.module('App.controllers',[]);

result

angular.module('App.controllers',[]);
angular.module('App',['App.controlers']);

Usage

var ngbuild=ngbuild;
ngbuild.build({
	src:'app.js',
    dest:'app.build.js'
});

var content=ngbuild.buildSync({
	src:'app.js'
});

Templates

Both html and jade /app.js

angular.module('App',[],function ($routeProvider) {
    $routeProvider
        .when("/url1", {
            templateUrl: "template.html"
        })
        .when("/url2", {
            templateUrl: "template.jade"
        });
}).directive('html',function(){
	return{
    	templateUrl:"template.html"
    }
}).directive('jade',function(){
	return{
    	templateUrl:"template.jade"
    }
});	

result

angular.module('App',[],function ($routeProvider) {
    $routeProvider
        .when("/url1", {
            template: "<span>template.html</span>"
        })
        .when("/url2", {
            template: "<span>template.jade</span>"
        });
}).directive('html',function(){
	return{
    	template:"<span>template.html</span>"
    }
}).directive('jade',function(){
	return{
    	template:"<span>template.jade</span>"
    }
});	

CSS

/app.js

angular.module('App',[],function ($routeProvider) {
    $routeProvider
        .when("/url1", {
        	styles:"styles.css",
            templateUrl: "template.html"
        })
})
...

result

angular.module('App',[],function ($routeProvider) {
    $routeProvider
        .when("/url1", {
            template: "styles{font-size:10px}<span>template.html</span>"
        })
})
...

Folders

directives folder

/app.js
/directives
	/module.js
    /directive.js

/app.js

angular.module('App',['directives']);

/directive/module.js(!special name of file with module declaration)

angular.module('App.directives',[]);

/directives/directive.js

angular.module('App.directives')
	.directive('directive',function(){
    ...
    });

result

angular.module('App.directives',[]);
angular.module('App.directives').directive('directive',function(){
...
});
angular.module('App',['App.directives']);

Subfolders

directives folder

/app.js
/directives
	/module.js
    /directive/
    	directive.js
        template.html
        styles.css

/app.js

angular.module('App',['directives/*']);

/directives/directive/directive.js

angular.module('App.directives')
	.directive('directive',function(){
    	return{
    		templateUrl:'template.html',
            styles:'styles.css'
    	}
	});

External libs

/app.js

angular.module('App',['!/lib/jquery.js']);

result

/**
* JQUERY HERE
**/
angular.module('App',[]);

Pathes

  • relative - 'file_path'
  • absolute - '/file_path'
  • library - '!(/)file_path
  • subdirectory - (/)directory_path/*

License

MIT

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.48

10 years ago

0.0.46

10 years ago

0.0.45

10 years ago

0.0.44

10 years ago

0.0.43

10 years ago

0.0.42

10 years ago

0.0.41

10 years ago

0.0.32

10 years ago

0.0.30

10 years ago

0.0.29

10 years ago

0.0.28

10 years ago

0.0.26

10 years ago

0.0.24

10 years ago

0.0.22

10 years ago

0.0.21

10 years ago

0.0.20

10 years ago

0.0.19

10 years ago

0.0.16

10 years ago

0.0.15

10 years ago

0.0.14

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago