typescript2.0

    2热度

    1回答

    我正在将退出的项目转换为打字稿。该项目使用包ng-idle,它有@types包名称angular-idle和文件@types/angular-idle/index.d.ts包含 declare module 'angular' { export namespace idle { .... 如何导入这个包 import * as ngIdle from 'angular-i

    0热度

    1回答

    说我有以下打字稿代码: export const makeMyClass = function(a: string, b: boolean){ const MyClass = function(){ }; MyClass.prototype.foo = function(){}; MyClass.prototype.bar = function(){

    0热度

    3回答

    我在打字稿 class Person { private variable1; public varibele2; Person(){ this.variable1 = 'abc'; this.varibele2 = 'xyz'; } public getVariable1(){ return this.va

    0热度

    1回答

    Angular 2+中有一个简单的警报模型框,我只需要使用它,而不是编写一个警报组件来定制它,然后使用它。

    0热度

    1回答

    我有两个单独的组件。一个是Modal生成器,它根据传递给它的信息创建一个模态,第二个组件仅用该相关信息调用该ModalComponent。 我有一个设置在单个页面上我想调用相同的ModalComponent但在两个不同的参数。所以当你点击它们时,第一个将显示第一组信息,第二个将显示第二组信息。问题是他们都显示第一组信息。在代码解释,这将是更容易: modals.component.html: 这是

    0热度

    1回答

    HY, 我有如下结构: <div fxLayout="row" fxLayout.xs="column" fxLayoutAlign="space-around start" fxLayoutGap="2%" style="padding:2%;"> <div fxFlex style="line-height:2;"> <md-card> <md-c

    0热度

    1回答

    有谁知道是否可以在Angular模块中导出枚举? 如果没有,有没有在Angular模块中发布枚举的最佳实践? // not working example // i dont know how to export GreatEnum import { NgModule } from '@angular/core'; import { CommonModule } from '@angula

    0热度

    1回答

    我正在使用Angular2,并希望检测用户点击浏览器中的“重新加载此页面”。 如何在打字稿中检测到此事件 - 这不是键盘事件。 到目前为止我试过: @HostListener('window:keydown', ['$event']) onKeyDown(event: MouseEvent) { console.log(event); alert("keydown "+ e

    1热度

    1回答

    我想解决如何做我认为会被称为'嵌套类型断言'。 Typescript将允许您通过接口声明一个空对象以构成接口的类型。例如: const fakeRequest = <ExpressCore.Request>{ protocol: 'test-protocol' }; 让我们我指定与作为一个ExpressCore.Request类型的协议字段集的对象(其具有许多属性 - https://gith

    0热度

    1回答

    类型说我有一个在它的package.json以下项目X: "typings": "lib/index.d.ts", "types": "lib/index.d.ts", 我希望导入所有类型的从index.d.ts文件进入另一个项目。 的index.d.ts文件看起来像: export declare const makePathExecutable: (runPath: string