Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the service file and try some Quill API
- Loading branch information
1 parent
875db66
commit 1f14796
Showing
6 changed files
with
90 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { ContentsService } from './contents.service'; | ||
|
||
describe('ContentService', () => { | ||
let service: ContentsService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(ContentsService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Injectable } from '@angular/core'; | ||
import Quill from 'quill'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class ContentsService { | ||
constructor() {} | ||
|
||
deleteText(quill: Quill) { | ||
quill.deleteText(4, 6); | ||
} | ||
|
||
getContent(quill: Quill) { | ||
const content = quill.getContents(); | ||
console.log(content); | ||
} | ||
|
||
getContentWithParams(quill: Quill) { | ||
const content = quill.getContents(27); | ||
// const content = quill.getContents(27, 5); | ||
console.log(content); | ||
} | ||
|
||
getLength(quill: Quill) { | ||
const length = quill.getLength(); | ||
console.log(length); | ||
} | ||
|
||
getText(quill: Quill) { | ||
const text = quill.getText(); | ||
console.log(text.toString()); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.