Giter Site home page Giter Site logo

angularjs-tern-plugin's Introduction

AngularJS-tern-plugin

tern 0.5 now has experimental angular support built in ternjs.net

Plugin for Tern that enables it to understand AngularJS dependency injection.

View Example

Installation

  1. Install tern
  2. Copy the angular.js file from this repository into your tern_for_sublime plugin directory. For Example:
  cp /path/to/angular.js ~/Library/Application Support/Sublime Text 3/Packages/tern_for_sublime/node_modules/tern/plugin
  1. Create your .tern-project file in the base of your project (if you haven't already) and add angular to the plugins. An example .tern-project file with this setup could be:
  {
    "libs": [
      "browser",
      "jquery",
      "ecma5",
      "underscore"
    ],
    "plugins": {
      "angular": "./"
    }
  }
  1. Make sure if you are using the AngularJS Sublime Text Package that you open User Settings for the package (AngularJS-sublime-package.sublime-settings) and change turn off default JS completions, e.g.:
  { "disable_default_js_completions": true }
  1. Completions will not work if you use a vanilla JS function.

Will not show completions:

function SomeCtrl($scope, $http) {
  $http. // <-- no completions here
}

But this will:

angular.module('MyApp', [])
.controller('SomeCtrl', function($scope, $http) {
    $http. // <-- you'll have completions now
});

The completions are worth the effort.

angularjs-tern-plugin's People

Contributors

bfricka avatar subhaze avatar

Watchers

 avatar

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.