Angular CLI with jQWidgets

In this tutorial, we will show you how to use https://cli.angular.io/ along with the Angular Components by jQWidgets.
Please, follow the step by step instructions below:

  • npm install -g angular-cli
  • ng new myProject
  • cd myProject
  • npm install jqwidgets-framework --save
  • ng serve
  • Edit src/index.html:
    <!doctype html>
    <html>

    <head>

    <meta charset="utf-8">

    <title>Jqwidgets</title>

    <base href="/">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="icon" type="image/x-icon" href="favicon.ico">

    <!-- Styles -->

    <link rel="stylesheet" href="http://www.jqwidgets.com/public/jqwidgets/styles/jqx.base.css" type="text/css" />

    <!-- jQWidgets -->

    <script src="http://www.jqwidgets.com/public/jqwidgets/jqxcore.js"></script>

    <script src="http://www.jqwidgets.com/public/jqwidgets/jqxdraw.js"></script>

    <script src="http://www.jqwidgets.com/public/jqwidgets/jqxbargauge.js"></script>

    </head>

    <body>

    <app-root>Loading...</app-root>

    </body>

    </html>

     
  • Edit src/app.component.ts:
    import { Component } from '@angular/core';
    import { jqxBarGaugeComponent } from 'jqwidgets-framework/jqwidgets-ts/angular_jqxbargauge';

    @Component({

    selector: 'app-root',

    templateUrl: './app.component.html',

    styleUrls: ['./app.component.css']

    })

    export class AppComponent {

    values: number[] = [102, 115, 130, 137];

    }

     
  • Edit src/app.component.html:
    <jqxBarGauge
    [width]="600" [height]="600" [colorScheme]="'scheme02'"

    [max]="150" [values]="values">

    </jqxBarGauge>

     
  • Edit src/app.module.ts:
    import { BrowserModule } from '@angular/platform-browser';
    import { NgModule } from '@angular/core';

    import { FormsModule } from '@angular/forms';

    import { HttpModule } from '@angular/http';

    import { AppComponent } from './app.component';

    import { jqxBarGaugeComponent } from 'jqwidgets-framework/jqwidgets-ts/angular_jqxbargauge';

    @NgModule({

    declarations: [

    AppComponent,

    jqxBarGaugeComponent

    ],

    imports: [

    BrowserModule,

    FormsModule,

    HttpModule

    ],

    providers: [],

    bootstrap: [AppComponent]

    })

    export class AppModule { }

     
  • Navigate to http://localhost:4200/ in your web browser
  • Result:

angular项目中使用jQWidgets的更多相关文章

  1. gulp 在 angular 项目中的使用

    gulp 在 angular 项目中的使用 keyword:gulp,angularjs,ng,ngAnnotate,jshint,gulpfile 最后附完整简洁的ng项目gulpfile.js 准 ...

  2. angular项目中各个文件的作用

    原文地址 https://www.jianshu.com/p/176ea79a7101 大纲 1.对angular项目中的一些文件的概述 2.对其中一些文件的详细描述 2.1.package.json ...

  3. Angular 项目中如何使用 ECharts

    在有些使用 ECharts 库的 Angular 项目中,通常除了安装 npm 包之外,还会在 angular.json 中配置 “build.options.scripts”,将 “node_mod ...

  4. angular项目中遇到的问题

    一.angular项目中如何实现路由缓存 需要实现的效果,对请求的数据进行缓存,比如进入文章详情页之后点击返回,不会再调用后台数据接口:而是加载缓存中的数据,如何数据变动的情况下,可使用下拉刷新刷新页 ...

  5. angular项目中使用Primeng

    1.第一步把依赖添加到项目中 npm install primeng --save npm install @angular/animations --save npm install font-aw ...

  6. Angular项目中引入jQuery

    npm install --save jquery npm install @types/jquery --save 在对应的组件中引入 import * as $ from "jquery ...

  7. 在angular项目中使用bootstrap的tooltip插件时,报错Property 'tooltip' does no t exist on type 'JQuery<HTMLElement>的解决方法和过程

    在angular4的项目中需要使用bootstrap的tooltip插件. 1. 使用命令安装jQuery和bootstrap npm install bootstrap jquery --save ...

  8. angular项目中使用jquery的问题

    1.使用npm命令往项目中添加jQuery. npm install jquery --save 2.在你想要用jQuery的组件中添加. import * as $ from "jquer ...

  9. Angular项目中共享模块的实现

    创建share Modele:ng g m share import进来所有需要共享的模块都export出去, 一.共享CommonModule 暂时只有CommonModule,以后会有一些需要共享 ...

随机推荐

  1. 【Java】数组升序和降序

    int[] x={1,6,4,8,6,9,12,32,76,34,23}; 升序: Arrays.sort(x); 降序: resort(x); public int[] resort(int[] n ...

  2. (转)Redis使用详细教程

    转载至http://www.cnblogs.com/wangyuyu/p/3786236.html 一.Redis基础部分: 1.redis介绍与安装比mysql快10倍以上 ************ ...

  3. 流媒体协议之RTP详解20170921

    1.RTP介绍 实时传输协议RTP(Real-time Transport Protocol)是一个网络传输协议,它是由IETF的多媒体传输工作小组1996年在RFC 1889中公布的,后在RFC35 ...

  4. Java配置jdk图文教程

    1.计算机 ==>右键属性 2.高级系统设置 3.环境变量 4.找path变量 5.找到jdk的bin目录并复制路径到path环境变量里(jdk5.0以后就可以只配path路径了). 6.pat ...

  5. PID控制算法的C语言实现十一  模糊算法简介

    在PID控制算法的C语言实现九中,文章已经对模糊PID的实质做了一个简要说明.本来打算等到完成毕业设计,工作稳定了再着力完成剩下的部分.鉴于网友的要求和信任,抽出时间来,对模糊PID做一个较为详细的论 ...

  6. php的自动加载函数spl_autoload_register和__autoload

    spl_autoload_register和__autoload是用来自动加载类的,不用每次都require,include这样搞. 先说__autoload的用法, 在同级目录建立2个文件,一个in ...

  7. AngularJs附件上传下载

    首先:angular-file-upload 是一款轻量级的 AngularJS 文件上传工具,为不支持浏览器的 FileAPI polyfill 设计,使用 HTML5 直接进行文件上传. 第一步: ...

  8. JAVA多线程提高五:原子性操作类的应用

    当程序更新一个变量时,如果多线程同时更新这个变量,可能得到期望之外的值,比如变量i=1,A线程更新i+1,B线程也更新i+1,经过两个线程操作之后可能i不等于3,而是等于2.因为A和B线程在更新变量i ...

  9. java中error和exception

    异常是指程序运行时发生的错误. Throwable是所有异常的父类,它有两个子类:Error和Exception. 1.Error表示程序在运行期间发生了非常严重的错误,并且该错误是不可恢复的.Err ...

  10. 去除UITableView多余的seperator

    UIView *v = [[UIView alloc] initWithFrame:CGRectZero]; [tableView setTableFooterView:v]; [v release] ...