Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/huanz/angular-lazy-render

angular lazy render page, speed up first screen
https://github.com/huanz/angular-lazy-render

Last synced: about 1 month ago
JSON representation

angular lazy render page, speed up first screen

Awesome Lists containing this project

README

        

# angular-lazy-render [![angular-lazy-render](https://img.shields.io/npm/v/angular-lazy-render.svg)](https://www.npmjs.com/package/angular-lazy-render)

renderng page by block

## Installation

```bash
npm install angular-lazy-render --save
```

## Usage

Once you have installed, you can import in your Angular `AppModule`:

```typescript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { LazyRenderModule } from 'angular-lazy-render';

import { AppComponent } from './app.component';

@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
LazyRenderModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```

wrap your page with ``, and then block your page, wrap each page block with ``

```html


section-0

{{title}}





section-1 first render


section-2



section-3

```

`index`: mark the first rendering block, default `0`

## Development

To generate all `*.js`, `*.d.ts` and `*.metadata.json` files:

```bash
$ npm run build
```

To lint all `*.ts` files:

```bash
$ npm run lint
```

## License

MIT © [angular-lazy-render](mailto:[email protected])