Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not display HTML data using API #103

Closed
sanjaypraja opened this issue Apr 14, 2017 · 7 comments
Closed

not display HTML data using API #103

sanjaypraja opened this issue Apr 14, 2017 · 7 comments

Comments

@sanjaypraja
Copy link

Hi,
I have tried to implement HTML editor in my project everything is working fine but when i tried to bind data from database using API, HTML editor does not display data in editor. if tried to bind data with class property then it works. Please look it.

@kzimny
Copy link
Collaborator

kzimny commented Apr 17, 2017

How the ckeditor is configured? Can you post your code?

@sanjaypraja
Copy link
Author

sanjaypraja commented Apr 18, 2017

*Binding in .html file
<ckeditor [(ngModel)]="componentDetails.componentData" name="componentDetails.componentData" debounce="500" [config]="{uiColor: '#99000'}">

*in .ts file, we call api request in ngOnInit() get the data and bind into "componentDetails" object

this.sub = this.route.params.subscribe(params => {
let id = params['id'];
this.service.getComponentDetails(id)
.subscribe(
body => {
this.componentDetails = body.data;
},
error => this.handleError
)
})

I have done few R&D and find that data bind ng-reflect-model in ckeditor but not bind in editor html body.
image

@kzimny
Copy link
Collaborator

kzimny commented Apr 18, 2017

Appropriated to your html code, the date should be loaded in iframe. Maybe something is set wrong in the config.js file? Can you try to load the ckeditor from CDN repository, just for a test? Load the ckeditor from CDN as follow:
<script src="https://cdn.ckeditor.com/4.5.11/full-all/ckeditor.js"></script>

@sanjaypraja
Copy link
Author

tried with new CDN path but not success :( . I think problem with delay in data binding bcz when i tried with class property with hard code value, it's binding.

@kzimny
Copy link
Collaborator

kzimny commented Apr 18, 2017

try to load data without promise method. look at this thread

@sanjaypraja
Copy link
Author

we are not using promise method. I tried to debug script and find that sometime CKEditorComponent is calling ( then data bind) and sometime it is not calling (then data not bind).

@sanjaypraja
Copy link
Author

problem has been resolved. In thread to use [config]="{extraPlugins: 'divarea'}".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants