Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

angular-wrapper

1.3.0 • Public • Published

angular-wrapper

angular-wrapper is an NPM module which is exposing Angular.js as a CommonJS module. This library is particularly useful if your project is using Webpack module bundler.

Angular.js 1.2 does not work well with CommonJS pattern and trying to load the module using "require" function returns empty object.

Some of us developers still have to support a bunch of browsers from last seasons (i.e. IE 8) but we want to use modern tools like Gulp, Webpack etc. This project can be used as a workaround for problem with loading Angular.js 1.2 using Webpack.

This project is not needed for Angular.js 1.3 and above

Installation

To install the library simply run:

npm install --save angular-wrapper

Usage

Here is example of loading Angular.js using this wrapper:

var angular = require("angular-wrapper");

var applicationModule = angular.module("my-example-module", []);

applicationModule.controller("HelloWorldController", ["$scope", function ($scope) {
  $scope.message = "Hello world!";
}]);

install

npm i angular-wrapper

Downloadsweekly downloads

6

version

1.3.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability