草庐IT

javascript - ngApp 不使用任何特定的模块名称

考虑下面的代码:部分html文件:{{name}}部分js文件:functionMainCtrl($scope){$scope.name="John";}我总是将我的Controller放在某个模块中,我在ng-app中定义其名称。当我没有定义任何模块时它是如何工作的? 最佳答案 Angular,具有这种“自动发现”功能,如果它们是在全局范围内定义的,则允许它按名称查找Controller。此功能主要用于快速演示/原型(prototype)/概念验证片段,而不是实际应用。来自Angular的DeveloperGuide:NOTE:A

express - Angular 2 通用 Heroku 部署

我一直在学习使用Angular2universal实现应用程序的教程。在heroku上,我得到了at=errorcode=H10desc="Appcrashed"method=GETpath="/"和server.ts是//thepolyfillsmustbethefirstthingimportedinnode.jsimport'angular2-universal/polyfills';import*aspathfrom'path';import*asexpressfrom'express';import*asbodyParserfrom'body-parser';import*a