Giter Club home page Giter Club logo

angular-namespacer's Introduction

angular-namespacer

Namespaces your Angular modules!

Angular Namespacer is a monkey patch for angular.module that allows you create a namespace of sorts for you services and what not.

angular
  .module('util', [])
  .namespace()
  .factory('thing', function () {
    return 1 + 2;
  });

angular
  .module('myApp', ['util'])
  .controller('MainCtrl', [
    '$scope',
    'util.thing',
    function ($scope, thing) {
      $scope.sweetData = thing;
    }
  ]);

options

angular
  .module('util', [])
  .namespace({
    delimiter: '.',
    methods: [
      'factory',
      'service',
      'provider',
      'constant',
      'value'
    ]
  });

global defaults

You can optionally configure a module to set the default options. This might be useful if you want to use '_' as your delimiter everywhere in the application

angular
  .module('ns', [])
  .value('config', {
    delimiter: '_'
  });

angular-namespacer's People

Contributors

battlesnake avatar callmehiphop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

angular-namespacer's Issues

Install instructions anywhere?

Hi

Have you guys have written instructions anywhere telling how to install this. Specifically, checking the code I don't see namespacer defined as an angular module, so I'm unsure if I should add it as an angular dependency of my application module.

Thanks for the nice job

ng-annotate

Hi.
Am I understanding correct that this module will not work if I use ng-annotate for DI annotations?

Thanks.

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.