IONIC3 - How to assign content from jquery to typescrypt

From GUILLARD WIKI
Revision as of 16:30, 29 March 2018 by Guillard (talk | contribs)
Jump to navigation Jump to search

In your .ts file:

import * as $ from 'jquery';
import { ElementRef, ViewChild } from '@angular/core';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  @ViewChild('debug') debugER: ElementRef;

example() {
Promise.all([]).then(data => {
// 1) Jquery code here
$('#debug').html(JSON.stringify(json, undefined, 2)); // 2) We use the html page to post the json data

    }).then(() => {
// When jquery is done, typescrypt function here 
      this.typescryptFunction()
    });
  }
}