0.9.15 ā€¢ Published 5 years ago

angular-hot-loader v0.9.15

Weekly downloads
564
License
ISC
Repository
github
Last release
5 years ago

Angular Hot Loader

Build Status npm version npm

šŸ”„ Webpack Hot Module Replacement for Angular 1.x applications.

Now works only with UI Router

Forked from Angular-HMR

Installation

  • npm

    npm install --save-dev angular-hot-loader
  • yarn

    yarn add --dev angular-hot-loader

Webpack setup

  • Webpack 2.x:
rules: [
  {
    test: /\.js$/,
    use: [
      'angular-hot-loader',
      // Any other loaders.
    ]
  }
]

With options:

rules: [
  {
    test: /\.js$/,
    use: [
      {
        loader: 'angular-hot-loader',
        options: {
          log: true,
          rootElement: 'html'
        }
      },
      // Any other loaders.
    ]
  }
]
  • Webpack 1.x:
loaders: [
  {
    test: /\.js$/,
    loader: 'angular-hot!...other loaders'
  }
]

Webpack Hot Module Replacement setup:

See Webpack documentation:

Options

rootElement {String}

Default: [ng-app]

Specifies application DOM root element selector. Use 'html' when boostraping your Angular app on document.

log {Boolean}

Default: false

Enables module output to console.

How it works

This will inject the new controller / template / service / whatever and then reload the state in UI Router.

Example app structure:

import MyFactory from './your-factory';
import MyCtrl from './your-controller';
import MyComponent from './your-component';

angular
  .module('my-app', [ui.router])
  .directive('MyDirective', require('MyDirective'))
  .factory('MyFactory', MyFactory)
  .controller('MyCtrl', MyCtrl)
  .component('myComponent', MyComponent);
0.9.15

5 years ago

0.9.14

6 years ago

0.9.13

6 years ago

0.9.12

6 years ago

0.9.11

6 years ago

0.9.10

7 years ago

0.9.9

7 years ago

0.9.8

7 years ago

0.9.7

7 years ago

0.9.6

7 years ago

0.9.5

7 years ago

0.9.4

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.9.0-alpha.3

7 years ago

0.9.0-alpha.2

7 years ago

0.9.0-alpha1.0

7 years ago

0.8.6

7 years ago

0.8.5

7 years ago

0.8.4

7 years ago

0.8.3

7 years ago

0.8.2

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.8

7 years ago

0.7.7

7 years ago

0.7.6

7 years ago

0.7.5

8 years ago

0.7.4

8 years ago

0.7.3

8 years ago

0.7.2

8 years ago

0.7.1

8 years ago

0.7.0

8 years ago