system.js没有加载基本的角度2模式的javascript文件,我不知道为什么。这是我的配置:
(function(global) {
var paths = {
'npm:': '../node_modules/'
};
// map tells the System loader where to look for things
var map = {
'app': 'js',
'@angular/core
我有一个角形6应用程序,当我在本地运行时,我的windows机器可以正常工作。当我克隆同样的爬虫并试图在我的MAC上运行它时,我得到的浏览器似乎只是‘加载’,并且在控制台中没有任何错误。
Angular CLI: 6.0.8
Node: 9.2.0
OS: MAC HIgh Sierra
Angular: 6.0.6
编辑 ->我在应用程序组件中添加了console.log语句,它击中了console.log。因此,这就像应用程序正在加载,但它没有呈现,即使浏览器看起来只是它的加载。
我能够将调试器语句放置到并开始调试。在zone.js中,有一个函数drainMicroTaskQueue
我在新的rails应用程序中使用angularjs。我将angularjs文件放在app/assets/angular/templates中,将css和js文件放在app/vender中。现在,当我运行项目时,css和js文件加载正确,但我不知道如何使用图像。我将图片放在html文件之外,但是当我运行项目时,我在chrome控制台中得到了以下错误:
ailed to load resource: the server responded with a status of 404 (Not Found)
assets/angular/templates/index.html
<li cl
注:我不使用角Cli。
我添加了@angular2-material/core包。然后,我安装了其他的angular2材料组件,如@angular2-material/button,@angular2-material/card等。
systemjs.config.js
/**
* System configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function(global) {
// map tells the System loader where
我的系统js配置看起来像
/**
* Created by nick_ on 5/7/2016.
*/
(function(global) {
// map tells the System loader where to look for things
var map = {
'app': 'app', // 'dist',
'rxjs': 'node_modu
我想从一个名为driverStandings.json的文件中加载json (您可以从图像中看到它留在结构中)。我使用服务API将这些数据加载到。我使用以下代码(就在图像中)。
当我编译时,我没有得到我的驱动程序列表,我得到了下面的错误列表
TypeError: url.replace is not a function
at angular.js:8557
at sendReq (angular.js:8426)
at $get.serverRequest (angular.js:8146)
at deferred.promise.then.wrap
在Angular 2中加载一个自举项目在维基中有很好的描述。好奇的是,我如何在一个使用angular-cli引导的项目中很好地加载一个更复杂的节点模块?
例如,angular2-apollo依赖于几个子依赖项,如apollo-client,graphql,lodash,...
我将节点模块添加到angular-cli-build.js
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
module.exports = function(defaults) {
return new Ang