如何AngularUI集成到AngularJS? [英] How to integrate AngularUI to AngularJS?

查看:83
本文介绍了如何AngularUI集成到AngularJS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,愚蠢的问题,每个人都知道如何开始使用AngularUI?我从Github上下载并阅读README中的指令,但还是不明白我必须做的。

Sorry for the silly question, does everyone know how to start using AngularUI? I've downloaded it from Github and read the instruction in README but still don't understand what I have to do.

推荐答案

步骤集成:


  • 包含的jQuery和jQuery的UI(最好从CDN服务)

  • 包含角(这是最好的从CDN包括IF)

  • 包含角UI JS / CSS(目前只在建立文件夹GitHub的库主办)

  • 包含任何jQuery插件为你计划使用的指令

  • 声明对角UI模块的依赖关系( ui.directives ui.filters 这取决于你是什么计划使用)。

  • Include jQuery and jQuery-ui (best served from a CDN)
  • Include angular (it is the best to include if from a CDN)
  • Include angular-ui JS / CSS (currently only hosted in the GitHub repository in the build folder)
  • Include any jQuery plugins for the directives you are planning to use
  • Declare dependencies on the angular-ui modules (ui.directives or ui.filters depending on what you are planning to use).

大部分介绍的步骤都差不多,包括JS / CSS的依赖。唯一的刁钻的部分是在UI上声明依赖*模块,你可以做这样的:

Most of the outlined steps are just about including JS/CSS dependencies. The only "tricky" part is to declare dependencies on a ui.* module, you can do it like this:

var myApp = angular.module('myApp',['ui.directives']);

一旦所有的依赖关系都包含并配置一个模块,你准备好了。例如,使用UI最新的指令就是这么简单(注意 UI的日期

<input name="dateField" ng-model="date" ui-date>

下面是展示了如何使用UI最新指令完整的jsfiddle: http://jsfiddle.net/r7UJ2/11/

Here is the complete jsFiddle showing how to use the ui-date directive: http://jsfiddle.net/r7UJ2/11/

您可能也想看看在 http://angular-ui.github.com/那里有掉所有的指令活生生的实例。

You might also want to have a look at the sources of the http://angular-ui.github.com/ where there are live examples off all the directives.

这篇关于如何AngularUI集成到AngularJS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆