Tag: 量angular器

如何用量angular器解决'你的系统失败'的错误?

我正在开发一个单一的Web应用程序,按照这个教程: https://docs.angularjs.org/tutorial 是什么原因使我产生了很大的问题,显然是量angular器端到端testing工具的正确configuration。 我已经完成了前面的所有步骤(安装npm,bower,jasmine等)。 然而,每当我尝试做相同的量angular器(当然是在适当的项目文件夹),控制台输出这个: angular-phonecat@0.0.0 protractor C:\Users\Michał Szydłowski\angular-phonecat > protractor test/protractor-conf.js util.puts: Use console.log instead Using ChromeDriver directly… [launcher] Error: Could not find chromedriver at C:\Users\Michał Szydłowski\angu lar-phonecat\node_modules\protractor\selenium\chromedriver.exe npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs \\node_modules\\npm\\bin\\npm-cli.js" "run" "protractor" npm ERR! node v0.12.3 npm ERR! npm v2.9.1 npm ERR! code ELIFECYCLE […]

Internet Explorer11使用量angular器工作速度太慢

我需要使用量angular器在Internet Explorer 11中运行我的testing用例。当我执行testing用例时,与Firefox和Chrome相比,它会消耗大量时间。 即使在文本框中input“Hello”文本,大约需要20秒。 有无论如何提高Internet Explorer 11的执行速度? 以下是我的量angular器细节: selenium独立服务器-2.47.1 节点JS-0.12.7 IE driverversion-IEDriverServer_x64_2.45.0 如果我们有提高速度的话,请提供详情和链接。 非常感谢。

从cmd和npm运行脚本运行量angular器的差异结果

运行此命令时,量angular器工作正常: $ protractor app/tests/e2e/conf.js 当我把这个命令放到package.json文件中时,为了使npm执行命令,量angular器不工作。 // package.json … "scripts": { "test": "protractor app/tests/e2e/conf.js" } 运行: $ npm run test 结果: 浏览器 安慰 为什么不给出相同的结果? 它只是冻结/挂起'数据' 文本在地址栏中。

Angular2 / TypeScript&HTTP:如何将对象附加到组件?

我试图显示一个restAPI的项目名称列表。 我在响应observable上调用map并订阅获取parsing的items对象。 如何将对象附加到组件并在html模板上显示item.name的列表? import { Component, bootstrap } from 'angular2/angular2'; import { Http, HTTP_PROVIDERS } from 'angular2/http'; @Component({ selector: 'item-app', viewProviders: [HTTP_PROVIDERS], templateUrl: 'app/content.html' }) class ItemsComponent { items: Object; constructor(http: Http) { http.get('http://localhost:3000/api/items') .map(response => response) .subscribe( items => this.items = items ); } } <ul> <li *ng-for="#item of items"> {{ item.name }} </li> […]

无法加载ngRoute模块

我正在使用Angular的Node.js项目,我试图实现多个视图和路由。 我已经按照这里列出的说明安装了angular-route.js文件和依赖模块: https://docs.angularjs.org/api/ngRoute 但我仍然在控制台中得到这个错误: Uncaught Error: [$injector:modulerr] Failed to instantiate module blogApp due to: Error: [$injector:modulerr] Failed to instantiate module ngRoute due to: Error: [$injector:nomod] Module 'ngRoute' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. […]

如何将FormData从Angular 2发送到nodejs?

我正在使用这个代码: var creds = "username=" + 'user' + "&password=" + 'password'; var headers = new Headers(); headers.append('Content-Type', 'application/x-www-form-urlencoded'); http.post('http://localhost:3000/', creds, { headers : headers }) .map(res => res.json()) .subscribe( data => this.logData(data), err => this.logError(err), () => console.log('Quote Complete') ); NodeJs在this.request.body上获得了json {username:'user',password:'password'}。 但我需要JSON像{字段:{用户名:'用户',密码:'密码'}}

强制量angular器等待种子数据加载

我必须为我的testing加载一些种子数据。 我很难确定在testing开始运行之前种子数据已经完全加载。 在beforeAll块中,我调用我为API编写的适配器,清除所有数据,加载种子数据的指定文件,然后运行从量angular器testing文件传入的callback。 我不能在callback中包含testing用例(这似乎是重构承诺会出现类似的阻塞问题),或者量angular器不能识别它们。 任何人都可以build议一种方法,我可以确保我的API已经成功种子在testing开始之前? 谢谢!

返回语句后无法访问的代码Angular Material在index.html中链接时失败

嗨,大家好,我只是为了一些工作而设立一个新的项目,试图快速地开展工作来保持动力。 但是,我似乎有一个问题,让Angular材料正确加载。 即时通讯使用节点和凉亭让我的模块,似乎正在加载他们罚款。 然而,当我加载页面时,我的控制台报告它在命名返回语句之后触发了一个无法访问的代码。 这实际上正在打击正在由凉亭import的angular材js文件。 我不知道为什么会发生这种情况,任何通过这一点的帮助都将是非常好的谢谢。 编辑 我可能已经find了解决我遇到的问题。 我使用的Web应用程序的后端由Django控制,Angular js和Django之间存在冲突,因为它们使用相同的标记来显示variables的值。 这是阻止angular材适当实例化。 我仍然得到无法达到的代码警告,但现在材料工作正如我所料。 我希望这可以帮助一些人解决他们在看到这个问题时遇到的问题。

tsconfig compilerOptions“module”:“system”not working

在angular2 5分钟的教程中,他们使用“system”作为tsconfig中的模块。 我有systemjs作为node_module,但是当试图启动我的服务器时,我得到的System is not defined ,从编译js文件,看起来像这样的第一行: System.register(['http', 'express', './config/index', 'path'], function(exports_1) { 为什么System未定义,即使我把它作为一个节点的依赖? 我试图改变它commonjs,然后编译的js看起来更简单。 但是,然后我在angular度应用程序中得到错误。 我为了与SystemJs一起工作而错过了什么? 编辑 我想我解释我的问题是不好的。 从导入模块更改为我的server.ts文件“JavaScript风格”( var http = require('http'); )我猜“打字稿样式”( import * as http from 'http'; ) import * as http from 'http';我开始得到错误上面指定。 当做它的JavaScript风格编译js看起来就像ts( var http = require('http'); )然而,当它做“打字稿风格”它被编译与模块导入使用系统(指定的代码行以上)。 所以当我试图启动节点服务器而不是在浏览器中出现这个错误。 我尝试更改编译选项“模块”为“commonjs”而不是“系统”在tsconfig.json,这样做会导致浏览器错误 ( 这个错误 ,只有解决scheme似乎不适合)一些奇怪的原因,所以我想我会尝试与“系统”。 但后来我遇到了没有定义System的问题。 那么在启动节点服务器时如何访问系统呢?

未捕获的SyntaxError:意外的标记<VM105:17未引用错误:系统未定义

我正在从nodejs服务器提供我的index.html。 这个ng2文件适用于现场服务器。 但是当我从具有特定路由的nodejs index.js加载它时,会出现以下错误。 Uncaught SyntaxError: Unexpected token < VM105:17Uncaught ReferenceError: System is not defined 我已经加载了正确的文件。 这里是加载的文件: <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.3/es6-shim.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.16/system-polyfills.js"></script> <script src="node_modules/angular2/bundles/angular2-polyfills.js"></script> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="node_modules/rxjs/bundles/Rx.min.js"></script> <script src="node_modules/angular2/bundles/angular2.min.js"></script> <script src="node_modules/angular2/bundles/router.js"></script> <script src="node_modules/angular2/bundles/http.js"></script> <!– 2. Configure SystemJS and Import –> <script> System.config({ packages: { client: { format: 'register', defaultExtension: 'js' } } }); System.import('client/boot') .then(null, […]