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

frozen with ionic #16

Open
jongchun opened this issue Jan 26, 2018 · 8 comments
Open

frozen with ionic #16

jongchun opened this issue Jan 26, 2018 · 8 comments

Comments

@jongchun
Copy link

Hello,

I am trying to use this with ionic.
After clicking the preview button 3 times, It's frozen. I have to refresh a page to use it.
But if I click the preview button 3 times, it happen again.

In app.modele.ts

import { SimplemdeModule, SIMPLEMDE_CONFIG } from 'ng2-simplemde/no-style'
imports:[
BrowserModule,
SimplemdeModule.forRoot(),
IonicModule.forRoot(MyApp)
]

and

added in index.html
In home.ts, added test:string; or test: any;
In home.html, added <simplemde [(ngModel)]="test">

@doxiaodong
Copy link
Owner

Can you provide a simple repo?

@jongchun
Copy link
Author

Too late? Sorry for this.

repo: https://github.com/jongchun/test

One more question. How to use this with ionic lazy loading?
If I add this to child module like these:
SimplemdeModule.forChild(post)
or
SimplemdeModule

I got errors both ways.

Thank You.

@doxiaodong
Copy link
Owner

@jongchun
Copy link
Author

jongchun commented Feb 1, 2018

sorry, my mistake.
added now.
Thank you.

@doxiaodong
Copy link
Owner

I don't provide forChild. It's only forRoot now.

@doxiaodong
Copy link
Owner

https://github.com/sparksuite/simplemde-markdown-editor/blob/6abda7ab68cc20f4aca870eb243747951b90ab04/src/js/simplemde.js#L768

since ionic will add '.activated' for a short time. and simplemde do not do right with that '.active' is not lastest class in classList. A fixed way is change all replace with ' ' in https://github.com/sparksuite/simplemde-markdown-editor/blob/6abda7ab68cc20f4aca870eb243747951b90ab04/src/js/simplemde.js
example

toolbarButton.className.replace(/\s*active\s*/g, " ");

@doxiaodong
Copy link
Owner

sparksuite/simplemde-markdown-editor#681.
You can make a pr for this.

@jongchun
Copy link
Author

jongchun commented Feb 1, 2018

Any future plan for lazy loading, SimplemdeModule or SimplemdeModule.forChild() ?

Thank You. ^^

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