-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfo.txt
More file actions
76 lines (55 loc) · 2.17 KB
/
info.txt
File metadata and controls
76 lines (55 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
**Hey fellow programmers**
I'm currently failing on integrating an angular2 directive - installed with npm - in my angular cli project.
**What I did so far:**
I clone the following git repo: https://github.com/avatsaev/angular-cli-seed
I was able to run the app with 'ng serve' without problems. Now, I want to use the Summernote WYSIWYG editor. Thank god, there is already an integration for angular 2 which can be found on the following page: https://www.npmjs.com/package/ng2-summernote
I installed this via 'npm install ng2-summernote' in my projet directory. It also shows up in my 'node_modules'-folder.
From now on, I dont know what to do. What i tried was the following code
(home.module.ts)
------------------------------------------------------------------
import { NgModule } from "@angular/core";
import { Ng2Summernote } from 'ng2-summernote/ng2-summernote';
import { homeRouting } from "./home.routing";
import { HomeComponent } from "./home.component";
@NgModule({
imports: [
homeRouting
],
declarations: [
HomeComponent,
Ng2Summernote
]
})
export class HomeModule { }
------------------------------------------------------------------
(home.component.ts)
------------------------------------------------------------------
import { Component, OnInit } from '@angular/core';
import { Ng2Summernote } from 'ng2-summernote/ng2-summernote';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.sass']
})
export class HomeComponent {
constructor(summernote: Ng2Summernote) {
summernote.lang = 'de-DE';
summernote.airMode = true;
}
say_hello(){
alert('Hello World')
}
}
------------------------------------------------------------------
(home.component.html)
------------------------------------------------------------------
<div class="section ribbon white-ribbon center">
<h2>
Welcome
</h2>
<button (click)="say_hello()" class="btn waves-effect btn-large red darken-2" type="submit" name="action">HELLO
<i class="material-icons right">language</i>
</button>
</div>
<ng2-summernote></ng2-summernote>
------------------------------------------------------------------