# ng-wordpress-templates

> Templates used by headless Wordpress with Angular

Latest version **0.1.1** (published 2017-10-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng-wordpress-templates
pnpm add ng-wordpress-templates
yarn add ng-wordpress-templates
bun add ng-wordpress-templates
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2017-10-26 |
| First published | 2017-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Philippe Schild |
| Maintainers | pschild |

## Links

- npm: https://www.npmjs.com/package/ng-wordpress-templates
- Repository: https://github.com/pschild/ng-wordpress-templates
- Homepage: https://github.com/pschild/ng-wordpress-templates#readme
- Issues: https://github.com/pschild/ng-wordpress-templates/issues
- npm.io page: https://npm.io/package/ng-wordpress-templates

## Recent versions

- 0.1.1 (latest) — 2017-10-26
- 0.1.0 — 2017-10-24
- 0.0.10 — 2017-10-17
- 0.0.9 — 2017-10-17
- 0.0.8 — 2017-10-17
- 0.0.7 — 2017-10-13
- 0.0.6 — 2017-10-13
- 0.0.5 — 2017-10-12
- 0.0.4 — 2017-10-12
- 0.0.3 — 2017-10-12
- 0.0.2 — 2017-10-10
- 0.0.1 — 2017-10-10

## README

This library contains different templates that can be used by a headless Wordpress application with Angular.

## How to use

The templates provided with this library are supposed to work with the corresponding theme/templates on the server side.
Therefore, download [pschild-angular-wordpress-theme](https://github.com/pschild/pschild-angular-wordpress-theme) and use it in your Wordpress installation.

First, install the library using
```
npm i ng-wordpress-templates --save
```

After that you can import the main module (```NgWordpressServicesModule```) and any of the template modules you want to use into your AppModule.

The ```NgWordpressServicesModule``` expects a configuration (containing URLs etc.) to be passed via ```forRoot()``` method.
You can either use static values or values read from your environment when you want to provide different values for different build types.

Important: the template modules use the configuration passed via ```NgWordpressServicesModule.forRoot()``` and also rely on services provided by this module, so don't forget to call the method.

```typescript
...
import {
    NgWordpressServicesModule,
    TplTextModule,
    TplGalleryModule,
    ...
} from '@ngWordpressTemplates';

@NgModule({
    ...
    imports: [
        ...
        NgWordpressServicesModule.forRoot({
            apiUrl: environment.apiUrl,
            staticSharerUrl: environment.staticSharerUrl,
            menuName: 'main'
        }),
        TplTextModule,
        TplGalleryModule,
        ...
    ],
    ...
})
```

## Templates
* Text: ```TplTextModule```
* Timeline: ```TplTimelineModule```
* Projects: ```TplProjectsModule```
* Posts: ```TplPostsModule```
* Codeblocks: ```TplCodeblocksModule```
* Gallery: ```TplGalleryModule```
* TextGallery: ```TplTextGalleryModule```
* TextMediaSlider: ```TplTextMediaSliderModule```

## Services
* ```PageService```
* ```PostService```
* ```MediaService```
* ```ProjectsService```
* ```TimelineService```
* ```NavigationService```

## Included Plugins (peer dependencies)
* https://github.com/orizens/angular2-infinite-scroll
* https://github.com/KoderLabs/ng2-device-detector
* (https://github.com/zyra/ngx-facebook)
* highlight.js - Code Highlighting
* hammerjs - Touch Gestures

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