问题标签 [angular-seed]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
3108 浏览

internet-explorer - No provider for PlatformRef error after upgrading to Angular2 RC5 in IE10

I just upgraded to Angular2 RC5. The app loads fine in all browsers exception IE10. I get an exception "No provider for PlatformRef!" when I bootstrap the application. Everything worked fine in RC4. I saw some posts on the web about this exception, but they were all related to Meteor. I do not use meteor. My project is derived from AngularSeed (previous version that I updated manually to RC5). Any idea on how to fix this? Thanks!

In IE10, I get this error:

main.ts:

AppModule:

Dependencies versions:

  • "@angular/common": "2.0.0-rc.5",
  • "@angular/compiler": "2.0.0-rc.5",
  • "@angular/core": "2.0.0-rc.5",
  • "@angular/forms": "0.3.0",
  • "@angular/http": "2.0.0-rc.5",
  • "@angular/platform-browser": "2.0.0-rc.5",
  • "@angular/platform-browser-dynamic": "2.0.0-rc.5",
  • "@angular/router": "3.0.0-rc.1",
  • "es6-module-loader": "^0.17.8",
  • "core-js": "^2.4.0",
  • "rxjs": "5.0.0-beta.6",
  • "systemjs": "0.19.27",
  • "zone.js": "0.6.13",

Edit: If I try to add PlatformRef to the @NgModule imports, I get this error:

I get this stack on IE:

0 投票
1 回答
642 浏览

javascript - Angular Seed - Install bower_components on the same directory folder level as app

So I recently used angular-seed in a code challenge as part of a job interview process. I got dinged for keeping bower_components inside the app folder.

Question 1: Is this really such a bad practice - to keep bower_components inside the app folder?

After getting dinged, I decided to install bower_components on the same level as the app folder. But of course, all the references in index.html no longer made sense since the references expected bower_components to be inside the app folder.

Question 2: How would I reference the bower_components outside the app folder? Would this need to be part of a build step to copy app to a ./public folder, then copy bower_compnents into ./public/app, then start the server and tell it to serve static files from ./public/app?

I modified the "prestart" command to accomplish this, but it just didn't feel right. And then there's also the issue of making changes in the app folder and then having to restart the server every time to see my changes in the browser.

What's the best practice here? I know the yeoman generator keeps bower_components outside the project root and a gulp/grunt task corrects the references, but I like angular-seed because it's pretty minimal and I'd like to just use npm for build tasks.

0 投票
10 回答
26522 浏览

angular - 对装饰器的实验性支持是一项可能在未来版本中更改的功能

我刚刚从 github 克隆了 angular2-seed 项目并按照步骤操作,但我在 VS 代码中收到了这个警告 [ts] 对装饰器的实验性支持是一项在未来版本中可能会更改的功能。设置“实验装饰器”选项以删除此警告。

0 投票
0 回答
317 浏览

angular - Angular2 - 独立应用程序与否 - 最佳实践

我和我的团队正在开始一个新的网络项目。我们打算使用 Angular2,它将在我们用于其他项目的经过验证且值得信赖的架构中替换 AngularJS。

该架构最值得注意的部分是一个 ASP.NET MVC 应用程序,它提供页面和 REST 端点。

这里的计划是提供两页。1. 登录页面和 2) 另一个安全页面上的 angular2 应用程序(需要身份验证)。

这似乎合乎逻辑,但事实证明将 angular2 应用程序集成到 MVC 项目中是一场噩梦。我们尝试了自定义 angular2 构建并尝试将几个 angular 种子(https://github.com/AngularClass/angular2-webpack-starter/https://github.com/mgechev/angular-seed)集成到MVC 应用程序。到目前为止,这被证明是一个又一个问题的黑客攻击,它只是没有飞行。

以下是问题:

  1. 这些种子是否曾经打算集成到另一个应用程序(例如 MVC 应用程序)中,还是打算独立运行?

  2. 一般来说,使用 angular2 的推荐方法是否实际上有一个单独的 angular2 应用程序与单独运行的后端 REST 服务通信?

    问题似乎是:

    一世。认证比较困难。

    ii. CORS 从一开始就是一个问题。

    iii. 部署更加困难,因为我们现在要部署两个网站。

我想这些问题可能被认为是模糊的,所以要具体一点:什么被认为是最佳实践。

两个独立的应用程序还是一个集成的应用程序?

非常感谢

约翰

0 投票
0 回答
175 浏览

angular - Angular 2 - 无效的外部依赖要求

在我的本地环境中它仍然有效。但继续集成服务器失败。我认为这发生在安装 ng2-bootstrap 之后。

这是我的 package.json

请帮我调试和解决依赖关系。

UPD。在具有空 angular2-seed 项目和上述依赖项的本地文件夹上:

在此处输入图像描述

0 投票
1 回答
1127 浏览

angular - ng2-validation 在 Angular2 角种子中不起作用

我正在尝试将ng2-validation集成到我的基于 Angular2角度种子的项目中。我已按照 ng2-validation 文档中提到的步骤进行操作,但出现以下错误。请在这方面帮助我。

0 投票
1 回答
4876 浏览

angular - 无法加载转译器来转译 AngularFire2

Traceur 404(未找到)无法加载转译器以转译 angularfire2.js http://localhost:3000/node_modules/angularfire2/angularfire2.js

我有一个 angular-seed 应用程序,我正在尝试添加 angularfire2。看来我在配置或版本中遗漏了一些东西。

以下所有配置。

控制台错误图像

包.json

systemjs.config.js

打字.json

tsconfig.json

0 投票
1 回答
127 浏览

angular - 使用 tfs 只读文件 (angular-seed) 构建 gulp

我正在使用 mgechev 的优秀角种子,但我的公司使用 TFS。当我构建时,由于 /dist 文件夹中的只读文件而出现 EPERM 错误。

我已经安装了 --save-dev gulp-chmod 并尝试将其添加到管道中以删除只读标志(注意:在 Windows 中工作)但是当我运行任务时它说“找不到模块 'gulp-chmod'”

我需要先在其他地方注册或映射 gulp-chmod 吗?

0 投票
0 回答
350 浏览

javascript - 获取依赖的源映射以使用 angular2 和 webpack

我的目标是有一个 angular2 项目设置,我可以在其中调试依赖项的源代码(位于 node_modules 目录中)。更准确地说,我希望能够在 chrome 开发工具中的实际打字稿文件(我不是指我自己的打字稿文件,而是依赖项的文件)中调试(例如设置断点)。如果依赖项包含源映射,这应该是可能的。

我尝试使用 angular-cli 但显然这还不可能,请参阅调试到 angular 2 typescript source code

所以我尝试从一个基本的 angular-seed 项目开始并对其进行调整。这个项目正在使用 webpack,我在 webpack.config.js 中添加了以下内容:

这实际上适用于像 rxjs 这样的一些包,但它不适用于 @angular 包,因为捆绑的文件(例如 core.umd.js 等)不包含源映射(由于这个错误,angular 2 团队删除了它们)。但只有捆绑的文件缺少源映射,src 文件夹中的非捆绑文件包含源映射。如何告诉 webpack 使用非捆绑文件而不是捆绑文件?

本文描述并解决了同样的问题,但他使用的是 SystemJS。我们如何用 webpack 解决它?

0 投票
0 回答
1708 浏览

javascript - Angular 2 - SystemJS 要求未定义

我一直在尝试将我的 angular-seed 项目从发布候选更新到发布版本。在更新了我的依赖项并修复了一些重大更改后,我在运行我的项目时遇到了这个错误:

我不明白为什么会这样,因为我没有触及任何与 SystemJS 相关的东西。这是我的 SystemJS 代码索引:

这是配置对象:

我怎样才能解决这个问题?