ionic项目之使用jquery

一、ionic项目操作(1)——引入jquery

    step1:在项目中引入jquery,目录结构如下

        ionic项目之使用jquery

        step2:在 TypeScript 中编写声明文件

                在src下新建js目录,并新建TypeScript声明文件jquery.d.ts,内容如下:

        declare var $:any;
    其中$的意思jquery的关键字,入过引入Three.js的话,将$改成Three就行,因为Three.js的关键字是Three 

        step3:在index.html中引入   

    <script type="text/javascript" src="assets/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="assets/js/three.js"></script>

           step4:在页面(ts)文件中引入

    ///<reference path="../../js/jquery.d.ts"/>

            注意:<1>、一定要在第一行(import上)

                    <2>、前边有三条///,不能少写

    这样就可以在页面中$(function(){ ... })了。