Visual Studio Code Debugger - 什么是app.js?

时间:2015-11-27 14:15:51

标签: angularjs debugging visual-studio-code

我使用gulp-angular yeoman生成器创建了一个AngularJS 1.4项目。

我希望能够在Visual Studio Code中启动它的调试模式。但是,我在网上看到的launch.json文件的大多数示例都建议将“program”值设置为“app.js”

UTF-8 without BOM

但Yeoman生成器尚未创建具有该名称的文件。

我应该在这里输入什么文件?定义Angular模块的文件?带路由代码的文件?

1 个答案:

答案 0 :(得分:1)

我认为app.js只是一个文件名,你可以给出任何名字。它只是用于包含应用程序中使用的所有模块的基础j。

例如: 在你的app.js

var MyApplicationName = angular.module('myModuleName', [ 'ui.bootstrap', 'ngAnimate', 'ui.grid', 'ui.grid.pagination', 'ui.grid.expandable', 'ui.grid.pinning']);

在我的其他MyController.js控制器中

MyApplicationName .controller('ControllerName', ['$scope', '$http', '$uibModal', function ($scope, $http, $uibModal) 

And in my other AnotherControler.js controller

MyApplicationName .controller('2ndControllerName', ['$scope', '$http', '$uibModal', function ($scope, $http, $uibModal)

希望这可以帮助你:)