【发布时间】:2018-01-02 14:39:27
【问题描述】:
我是打字稿的新手。 我有一个 angularjs 控制器,我正在尝试将其转换为 typescript 控制器。
首先我声明了控制器和模块
/// <reference path='../../Scripts/typings/angularjs/angular.d.ts' />
/// <reference path='../../Scripts/typings/jquery/jquery.d.ts' />
'use strict'
interface IRouteParams extends ng.route.IRouteParamsService {
propertyAddress: string;
}
class Controller1 {
public propertyAdd: string;
constructor($scope: any,
$routeParams: IRouteParams,
ServicesFactory,
growl,
blockUI,
IMAGE_RELATED_MESSAGES,
BUSY_MESSAGES,
$timeout: ng.ITimeoutService,
$modal,
Lightbox,
$filter) {
this.propertyAdd = $routeParams.propertyAddress;
}
}
angular.module('Controller').controller('Controller1', Controller1);
当我在浏览器中运行此代码时,出现以下错误
拒绝执行来自“http://localhost/....../Controller1.ts”的脚本,因为它的 MIME 类型 ('video/vnd.dlna.mpeg-tts') 不可执行。
痛点是什么?
【问题讨论】:
标签: angularjs typescript