AngularJS ui-router是否有任何Typescript定义?

前端之家收集整理的这篇文章主要介绍了AngularJS ui-router是否有任何Typescript定义?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用带有ui-router的打字稿.有没有人为此找到任何打字稿定义.我看着肯定打字,什么也看不见.这是我想要找到的接口文件
$stateProvider
我们正在使用这个d.ts用于ui-router:

更新的链接,2015年5月

https://github.com/borisyankov/DefinitelyTyped/blob/master/angular-ui-router/angular-ui-router.d.ts

原始版本(准备复制/粘贴)

https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/angular-ui-router/angular-ui-router.d.ts

升级说明:

当我将angular-ui-router.d.ts更新到最新版(2015年5月)时,我也遇到了很少的构建问题.解决方案简而言之就是

  • angular definition was converted
    • from: declare module ng {
    • into: declare module angular {
  • so update angular.d.ts to the 07002
  • updated all related (existing) d.ts as well (angular-animate.d.ts,angular-sanitize.d.ts…)
  • change all other (custom) modules declarations like
    • declare module ng.XXX { into
    • declare module angular.XXX {

通过这几个步骤…所有应该再次工作
(original,不工作链接)

资源的小代码片段形式:

// Type definitions for Angular JS 1.1.5+ (ui.router module)
// Project: https://github.com/angular-ui/ui-router
// Definitions by: Michel Salib <https://github.com/michelsalib>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

/// <reference path="../angularjs/angular.d.ts" />

declare module ng.ui {

    interface IState {
    ...

使用示例

module MyModule
{
    export class MyStateConfig
    {
        constructor(private $stateProvider: ng.ui.IStateProvider,private $urlRouterProvider: ng.ui.IUrlRouterProvider
            ...)
        {
            this.$stateProvider.state(...
原文链接:https://www.f2er.com/angularjs/142352.html

猜你在找的Angularjs相关文章