Check out the website.
angular_init (called ngi
) creates AngularJS templates for you from the command line so you don't have to type the same starting code over and over again. It's a tool with just one purpose, so it's small and fast.
$ gem install ngi
$ cd ~/MyAwesomeApp # => go to your app
$ ngi controller # => create a new AngularJS controller
// ~/MyAwesomeApp/myAwesome.controller.js
;(function(app) {
'use strict';
app.controller('MyAwesomeController',MyAwesomeController);
MyAwesomeController.$inject = ['$route', '$scope'];
function MyAwesomeController($route, $scope) {
}
})(angular.module('myModule'));
By the way, the output of this little tool is meant to follow John Papa's AngularJS Style Guide.
- You can now use custom templates (tutorial)
Have an idea for a feature? Email [email protected]! Just write: "Hey, I think it would be awesome if you included ____ in ngi because ____."
- Has default templates to create components for you (directives, controllers, etc.) in ECMAScript5 and CoffeeScript (type
ngi -h
to see all the available components). By the way, the default templates follow John Papa's AngularJS Style Guide. - Supports custom templates (see the tutorial for that)
You need Ruby 2.1.0 and RubyGems (optional Bundler)
Add this line to your application's Gemfile:
gem 'ngi'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ngi
- Contribute just like you would any other GitHub project (fork and submit a pull request; check out GitHub's guide for that)
- Or, email [email protected] if you have an awesome idea for a feature!
Only tested with Ruby 2.1 on Mac OSX Mavericks. Compatibility with previous versions of Ruby cannot be guaranteed.
angular_init
and ngi
and the author (Joshua Beam) are not directly associated with AngularJS.
Copyright © 2015 Joshua Beam — Front End Collision
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.