# angular-hmr

> Angular Hot module replacement

Latest version **0.2.0** (published 2016-03-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install angular-hmr
pnpm add angular-hmr
yarn add angular-hmr
bun add angular-hmr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2016-03-14 |
| First published | 2015-06-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 34 |
| Author | Steve |
| Maintainers | yargalot |
| Keywords | Angular, webpack, HMR |

## Links

- npm: https://www.npmjs.com/package/angular-hmr
- Repository: https://yargalot@github.com/yargalot/Angular-HMR
- Homepage: https://github.com/yargalot/Angular-HMR#readme
- Issues: https://github.com/yargalot/Angular-HMR/issues
- npm.io page: https://npm.io/package/angular-hmr

## Dependencies (1)

- [source-map](https://npm.io/package/source-map.md) ^0.4.2

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2016-03-14
- 0.1.1 — 2015-06-02
- 0.1.0 — 2015-06-01

## README

# Angular HMR

[![Join the chat at https://gitter.im/yargalot/Angular-HMR](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/yargalot/Angular-HMR?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

A (very alpha version) Webpack loader for Hot Module Replacement in Angular applications.

This will only work in Ui Router at the moment with a specific app structure shown below. Will work on it a bit more over the week.

Throwing up a sample app up at https://github.com/yargalot/Angular-HMR-Example

## How it works
This will inject the new controller / template then reload the state in UI Router

Say your structure was all like

```
angular
  .module('app.components')
  .directive('sessionItem',function() {
    return {
        restrict : 'E',
        scope: {
            session: '='
        },
        bindToController: true,
        controllerAs: 'state',
        replace: true,
        controller: 'sessionItemCtrl',
        template: require('./template.html')
    };
  })
  .factory('TestFactory', function() {
    console.log('derp');
  })
  .controller('sessionItemCtrl', require('./sessionItemCtrl'));
```

and you save that the browser should refresh

### NOTE
This is pulled from https://github.com/jeroenverfallie/angular-hmr-loader and https://github.com/bitsoflove/jsconfbe-2015

Just more developing on top of that idea. Would feel bad for not mentioning that

---
_Source: https://npm.io/package/angular-hmr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
