# ng-pug-inline-template-loader

> Webpack loader that transform angular inline templates from pug into html

Latest version **0.12.0** (published 2019-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng-pug-inline-template-loader
pnpm add ng-pug-inline-template-loader
yarn add ng-pug-inline-template-loader
bun add ng-pug-inline-template-loader
```

## 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.12.0 |
| Published | 2019-02-21 |
| First published | 2018-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Håkan Fahlstedt |
| Maintainers | hfahlstedt |
| Keywords | pug, angularjs, inline, template, webpack, html |

## Links

- npm: https://www.npmjs.com/package/ng-pug-inline-template-loader
- Repository: https://github.com/HFahlstedt/ng-pug-inline-template-loader
- Issues: https://github.com/HFahlstedt/ng-pug-inline-template-loader/issues
- npm.io page: https://npm.io/package/ng-pug-inline-template-loader

## Dependencies (2)

- [pug](https://npm.io/package/pug.md) ^2.0.0-rc.4
- [loader-utils](https://npm.io/package/loader-utils.md) ^1.1.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.12.0 (latest) — 2019-02-21
- 0.11.0 — 2018-03-12
- 0.0.1 — 2018-02-22

## README

# ng-pug-inline-template-loader
Loder for webpack to make it possible to use [pug](https://pugjs.org) in angularjs component inline templates.

It is meant to be used as a precompile step before transpiling Typescript into JavaScript. It has, currently, only been tested with webpack 3.

If the Typescript file doesn't include a template or the template starts with '<' (indicating that the template is in html) the loader will just pass the source along.

## Installation
### npm
```
npm install ng-pug-inline-template-loader
```
### yarn
```
yarn add ng-pug-inline-template-loader
```
## Usage

### Webpack 3
Add this loader before you transpile the Typescript files:

```javascript
module.exports = {
    module: {
        rules: [
            {
                test: /\.ts$/,
                use: [
                    'ts-loader',
                    'ng-pug-inline-template-loader'
                ]
            }
        ]
    }
}
```

In your Typescript file you need to use back-ticks (`) surrounding the template, to make this loader convert the markup:

```javascript
import { app } from './app.module';

const selector = 'someCoolComponent';

@Component(app, selector, {
    template: `
        .cool-component
            p Some text paragraph
        #footer
            span This is the footer
`
})
export class SomeCoolComponent {

...

}
```
The above code will be converted like this:

```javascript
import { app } from './app.module';

const selector = 'someCoolComponent';

@Component(app, selector, {
    template: `<div class="cool-component">
  <p>Some text paragraph</p>
</div>
<div id="footer"><span>This is the footer</span></div>`
})
export class SomeCoolComponent {

...

}
```

---
_Source: https://npm.io/package/ng-pug-inline-template-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
