ionic2 EXCEPTION:jQuery没有定义

时间:2016-11-23 10:17:19

标签: angular ionic2

我不能包含Jquery,尝试通过此视频执行:bootstrap github issues page

1)包含了Index.html的脚本:

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/3.0.0/jquery-migrate.js"></script>

2)

import { Component, ElementRef, Renderer, ViewChild } from '@angular/core';
import { HomePage } from '../home/home';
import { AboutPage } from '../about/about';
import { ContactPage } from '../contact/contact';
import { RegistrationPage } from '../registration/registration';

declare var jQuery: any;

@Component({
  templateUrl: 'tabs.html'
})

export class TabsPage {
  // this tells the tabs component which Pages
  // should be each tab's root Page

  tab1Root: any = HomePage;
  tab2Root: any = AboutPage;
  tab3Root: any = ContactPage;

  constructor(public element: ElementRef, public renderer:Renderer) {
  }

  ngOnInit(){
    console.log("NG ON CHAN START DATE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    console.log('test ', jQuery(this.element.nativeElement).find('body'));

  }

3)在浏览器中测试:离子发送-l

4)得到错误 EXCEPTION:未定义jQuery

请帮助某人

0 个答案:

没有答案