【问题标题】:Application.js get cleaned up when building project with Visual Studio使用 Visual Studio 构建项目时清理 Application.js
【发布时间】:2015-01-30 00:05:46
【问题描述】:

我已经下载了示例https://github.com/tastejs/todomvc/tree/master/examples/typescript-angular,并尝试让它在 VS2013 Web 应用程序空模板下工作。 我添加了示例的所有文件,我通过 IIS 启动了网站,它工作正常。

但是当我构建项目(不修改任何内容)时,剩下的唯一几行是:

/// <reference path='_all.ts' />
/**
* The main TodoMVC app module.
*
* @type {angular.Module}
*/
var todos;
(function (todos) {
    'use strict';

    var todomvc = angular.module('todomvc', []).controller('todoCtrl', todos.TodoCtrl).directive('todoBlur', todos.todoBlur).directive('todoFocus', todos.todoFocus).service('todoStorage', todos.TodoStorage);
})(todos || (todos = {}));

当我尝试运行该网站时,出现以下错误:

http://localhost/WebAppTodoMvc/bower_components/angular/angular.js

0x800a139e - Erreur d’exécution JavaScript: [$injector:modulerr] Failed to instantiate module todomvc due to
Error: [ng:areq] Argument 'directiveFactory' is required

【问题讨论】:

  • 我建议你在 GitHub 存储库上打开一个问题

标签: angularjs visual-studio typescript


【解决方案1】:

该代码旨在与--out 编译器标志一起使用,您应该使用从all.ts https://github.com/tastejs/todomvc/blob/master/examples/typescript-angular/js/_all.ts 生成的_all.js

您可以将其指定为项目属性中的参考文件

【讨论】:

    猜你喜欢
    • 2011-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-30
    • 2021-08-08
    • 2018-11-04
    • 2018-06-02
    • 2021-10-06
    相关资源
    最近更新 更多