Angular 4 Component for embedding a gist within an Angular site
In order to use the component in your Angular 4 project after installation, follow these steps:
- Declare
NgxGistModulewithin app.module.ts
import { NgxGistModule } from 'ngx-gist/dist/ngx-gist.module'; @NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
NgxGistModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }- Use the
ngx-gistcomponent in any template files by using thengx-gisttag along with username and gistId
<ngx-gist [gistId]="'{username}/{gistId}'"></ngx-gist>- Updated Support For Particular File in a gist
<ngx-gist [gistId]="'{username}/{gistId}'" [file] = "'<name of the file in gist>'"></ngx-gist>the file parameter is a optional paramater
This project was initiated after a search for an Angular 4 component of its kind returned no results.
npm i --save ngx-gist
MIT