在角度2中使用CKEditor.d.ts typescript定义文件

时间:2016-04-13 08:16:13

标签: angular angular2-directives

我有一个角度为2的项目,我想使用来自DefinitelyTyped Repo的CKEditor打字稿定义

  

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/ckeditor/ckeditor.d.ts

问题是我收到错误Evaluating http://localhost:3000/typings/ckeditor/ckeditor.d.ts这是包含ckeditor文件的代码。

import {CoursesService} from "../../../services/courses"
/// <reference path="../../../../typings/ckeditor/ckeditor.d.ts" />

import {CKEDITOR} from "../../../../typings/ckeditor/ckeditor.d.ts"
export class CreateCourseComponent implements OnInit {
    ngOnInit(){
        CKEDITOR.replace('text_area');
    }
}

1 个答案:

答案 0 :(得分:0)

定义文件不是模块,只是编译时间,所以删除这一行:

import {CKEDITOR} from "../../../../typings/ckeditor/ckeditor.d.ts" 

使用脚本标记导入CKEditor。