ng2-alt-summernote
Component to use Summernote in Angular 2.
Example:
The example repo is located here.
Usage with Angular CLI:
To use it with angular-cli:
-
Install jquery, bootstrap and summernote:
npm install --save jquerynpm install --save bootstrapnpm install --save summernote -
Add styles to
angular-cli.json
:"styles":, -
Add
vendor.ts
file with the following content:;window = window = jquery;and add it to `angular-cli.json' scripts:
"scripts": -
Install
ng2-alt-summernote
:
npm install --save ng2-alt-summernote
5. Import SummernoteModule
, ssbootstrap
and summernote
in app.module.ts
:
```typescript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import 'bootstrap/dist/js/bootstrap.min.js';
import 'summernote/dist/summernote.min.js';
import {SummernoteComponent} from 'ng2-alt-summernote';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
SummernoteComponent,
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```
-
Use it in you components:
Usage with Webpack:
To install in a webpack project:
-
Install required packages:
npm install --save bootstrapnpm install --save font-awesomenpm install --save codemirrornpm install --save summernotenpm install --save ng2-alt-summernote -
Import modules in
vendor.ts
(if available, if not use another typescript file):;;;;;;;; -
Import module in you
NgModule
:;;;;;;;; -
Use it in your components:
Note:
This module is based on ng2-summernote. I tried forking the repo to fix the issues I was having but decided to start from scratch because it had some things that I didn't need.