Created
January 19, 2017 06:49
-
-
Save amitmerchant1990/efab4114a0d838f329cf4e923cd1e3db to your computer and use it in GitHub Desktop.
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
import { Component, ViewChild } from '@angular/core'; | |
import { Content } from 'ionic-angular'; | |
import { NavController } from 'ionic-angular'; | |
import marked from 'marked'; | |
@Component({ | |
selector: 'page-home', | |
templateUrl: 'home.html' | |
}) | |
export class HomePage { | |
@ViewChild(Content) content: Content; | |
constructor(public navCtrl: NavController) { | |
//console.log(marked('I am using __markdown__.')); | |
} | |
convert(this) { | |
if(this.toggleVal==true){ | |
if(this.plainText && this.plainText!=''){ | |
let plainText = this.plainText | |
this.markdownText = marked(plainText.toString()) | |
this.content = this.markdownText | |
}else{ | |
this.toggleVal=false | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment