Giter Club home page Giter Club logo

angularinject's Introduction

Sublime Text 2 Plugin : AngularInject

Convenient Sublime Text 2 Plugin to quickly inject a dependency into any AngularJS module

##Installation

With Package Control:

Just search for AngularInject package and confirm. Tada !

Manually:

Download and extract into your ST2 Packages folder. That's it. This directory can be found on Mac OS at ~/Library/Application Support/Sublime Text 2/Packages/

##Usage

####Note: this plugin only work (yet) with inline annotation. It doesn't work (yet) with static injection (example: MyController.$inject = ['$scope', 'greeter'];).

By default the plugin can be called with Cmd + Alt + i (Mac OS) and Ctrl + Alt + i (Windows & Linux). You can also use the Command Palette to find AngularJS: Inject Dependency (any word should work).

You should see the quick panel (bottom of ST2 screen). Just type in the dependency you wish (for instance $window). Shazam !

Your module should looks like this :

angular.module('myApp.controllers', []).controller('MyCtrl', [ '$http', function($http) { ... }

and to something like this after the plugin action (notice the $window injection)

angular.module('myApp.controllers', []).controller('MyCtrl', [ '$http', '$window', function($http, $window) { ... }

If multiple modules exist on the same file, you will be ask to chose the one to inject.

##Next Step ###Know issues A lot ? ###Todo

  1. Allow to remove an injection from the module
  2. Make the plugin work with no min-safe version (MyCtrl.$inject[…] or controller('MyCtrl', function()…)3. inject)
  3. Insure that the modified line is really the [ function() from the module

##Contributing Feel free to modify, share, comment any bug or fork. Just drop a tweet if you do !

angularinject's People

Contributors

ayamflow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ronandrouglazet

angularinject's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.