angular项目中使用jQWidgets

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:
时间: 2025-01-06 14:18:15

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

angular项目中各个文件的作用

原文地址 https://www.jianshu.com/p/176ea79a7101 大纲 1.对angular项目中的一些文件的概述 2.对其中一些文件的详细描述 2.1.package.json 2.2.tsconfig.json 2.3.Polyfills 对angular项目中的一些文件的概述 angular-cli.json Angular CLI 的配置文件. 在这个文件中,你可以设置一系列默认值,还可以配置项目编译时要包含的那些文件. karma.conf.js karma 测试

angular项目中使用Primeng

1.第一步把依赖添加到项目中 npm install primeng --save npm install @angular/animations --save npm install [email protected] --save 2.在.angular-cli.json中添加 "styles": [ "styles.css", "../node_modules/primeng/resources/primeng.min.css", &quo

angular项目中使用jquery的问题

1.使用npm命令往项目中添加jQuery. npm install jquery --save 2.在你想要用jQuery的组件中添加. import * as $ from "jquery"; 3.就可以正常使用了.

angular项目中常用的npm命令

1:创建项目:ng new name 2:创建模块:ng g component home或者ng g module about.后者多了一个module.ts文件.这里面的home和about都是模块的名字 3:angular material2:npm install --save@angular2-material/core@angular2-material/button@angular2-material/card@angular2-material/radio@angular2-ma

angular项目中使用angular-material2

Step 1: Install Angular Material and Angular CDK npm install --save @angular/material @angular/cdk npm install --save angular/material2-builds angular/cdk-builds Step 2: Animations Some Material components depend on the Angular animations module in o

在Angular项目下使用Umeditor

Umeditor是百度旗下的开源富文本编辑器项目,目前用于百度贴吧,是ueditor的迷你版本. 公司的Angular后台管理项目需要上传一些新闻,用Umeditor十分适合.但是目前官方只提供Jsp,Asp,Php和.net版本,也就是说只支持一般页面应用.而每次初始化编辑器时,都需要加载一次 umeditor.min.js文件: <script type="text/javascript" charset="utf-8" src="./js/li

如何在程序开发项目中选择合适的 JavaScript 框架,节省时间和成本的9款极佳的JavaScript框架介绍

从技术上来看,iOS,Android 和 Windows Phone 上的移动应用是使用不同的程序语言开发的,iOS 应用使用 Objective-C,Android 应用使用 Java,而 Windows Phone 应用使用 .NET. .随着 JavaScript,CSS 和 HTML 知识技能的提升,相信你也可以构建一个超赞的移动应用.在这篇博客里,我们将会介绍一些极好的 JavaScript 移动应用程序开发框架. 说到网络开发,就不得不说 JavaScript,这是一款很有前途的程序

项目中jquery插件ztree使用记录

最近公司要求做一个关于后台的管理系统.在这个mvvm模式横行的年代,虽然这里用jquery做项目可能有点不符合时代的潮流,但是管他呢,能做出来先在说呗(公司以后要改用angular或者vue来统一前端的制作方式),个人觉得jquery还挺好用的.废话这里就不多叙述了.下面就先来一张完成后的图片展示一下ztree可以完成的功能. 额····这边弹出层的阴影是录制软件的问题(这边的前端插件用的是layui,想用的小伙伴可以自行百度layui,顺便一提,我这里用的版本是layui 1.0的,现在lay

ionic新手教程第三课-在项目中使用requirejs分离controller文件和server文件

继上篇教程中提到的,我们新建一个简单的tabs类型的Ionic项目. 依据文件夹文件我们知道,系统自己主动创建了一个controller文件和server文件,而且把全部的控制器和服务都写到这两个文件中面. 这是一个简单的项目,业务逻辑代码也非常少.这样子实现并没有什么问题.可是当我们的项目越写越多.业务逻辑越来越复杂.假设我们还是把全部的控制器写到同一个文件中面.那可能我们将要面对的就是一个有着上万行代码的文件. 每次编辑仅仅能通过搜索keyword来定位了. 所以真正编辑项目的时候我们应该都