Skip to content

Commit

Permalink
added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Wilson committed Oct 16, 2012
1 parent 0b9f1e7 commit 7938464
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ module.exports = function(name, cb) {
ctrl = item.replace('index', name);
fs.writeFileSync(path.join('.', ctrl.replace('.ejs', '')), result);
});
console.log('REMEMBER:');
console.log('Add your new controller and template to your route provider!');
cb(null);
}
18 changes: 18 additions & 0 deletions cmd/directive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var ejs = require('ejs'),
fs = require('fs'),
path = require('path');

var templateDir = __dirname + '/../template';

module.exports = function(name, cb) {
// generate directivejs
var templates = ['app/scripts/directives/index.js.ejs'],
data = { name: name, title: name, view: name };
templates.forEach(function(item){
var ejsTemplate = fs.readFileSync(path.join(templateDir, item)),
result = ejs.render(ejsTemplate.toString(), data),
ctrl = item.replace('index', name);
fs.writeFileSync(path.join('.', ctrl.replace('.ejs', '')), result);
});
cb(null);
}
4 changes: 4 additions & 0 deletions cmd/service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = function(name, cb) {
console.log('under construction...');
cb(null);
}
28 changes: 28 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ng - [Experimental]

CLI Build Tool for AngularJS

## Install

``` sh
npm install ng -g
```

## Commands

``` sh
ng init [project]
```

``` sh
ng controller [detailsCtrl]
```

``` sh
ng directive [myautocomplete]
```

``` sh
ng service [myresource]
```

5 changes: 5 additions & 0 deletions template/app/scripts/directives/index.js.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
app.directive('<%= name %>', function factory() {
return function postLink(scope, element, attrs) {

}
});

0 comments on commit 7938464

Please sign in to comment.