Difference between revisions of "IONIC3 - How to assign content from jquery to typescrypt"

From GUILLARD WIKI
Jump to navigation Jump to search
(Created blank page)
 
Line 1: Line 1:
In your .ts file:


<syntaxhighlight lang="python">
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()
    });
  }
}
</syntaxhighlight>

Revision as of 16:30, 29 March 2018

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()
    });
  }
}