JSPM

  • Created
  • Published
  • Downloads 328
  • Score
    100M100P100Q92030F
  • License ISC

Webpack loader for Hot Module Replacement in Angular 1.x applications.

Package Exports

  • angular-hot-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (angular-hot-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Angular Hot Loader

npm version

Webpack loader for Hot Module Replacement in Angular 1.x applications.

Now works only with UI Router with a specific app structure shown below.

Forked from Angular-HMR

Webpack setup

  1. Install loader:
npm install --save-dev angular-hot-loader
  1. Add loader to webpack configuration:
loaders: [
  {
    test: /\.js$/,
    loader: 'angular-hot!...other loaders'
  }
]

Options

rootElement {String}

Default: [ng-app] Specifies application DOM root element selector.

log {Boolean}

Default: true Enables module output to console.

How it works

This will inject the new controller / template then reload the state in UI Router

Your app structure should be something like:

import MyDirective from './your-directive';
import MyFactory from './your-factory';
import MyCtrl from './your-controller';

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

and you save that the browser should refresh