Tag: 量angular器

为什么具有真正Headless选项的Chrome 59-Beta无法使用量angular器?

我想用最新的Chrome 59-Beta和–headless Option来testing我们的Angular Project(github .com / h-da / geli)。 我能够使用新的GC-Beta的karma ,但是我不能用新的GC-Beta来运行protractor 。 我试图在jenkins和我的当地stream浪者机器上运行量angular器,都给了我同样的错误: [17:13:12] I/direct – Using ChromeDriver directly… [17:14:12] E/launcher – chrome not reachable (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.4.0-51-generic x86_64) [17:14:12] E/launcher – WebDriverError: chrome not reachable (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.4.0-51-generic x86_64) at Object.checkLegacyResponse (/home/travis/build/[secure]/geli/app/webFrontend/node_modules/selenium-webdriver/lib/error.js:505:15) at parseHttpResponse (/home/travis/build/[secure]/geli/app/webFrontend/node_modules/selenium-webdriver/lib/http.js:509:13) at doSend.then.response (/home/travis/build/[secure]/geli/app/webFrontend/node_modules/selenium-webdriver/lib/http.js:440:13) at process._tickCallback […]

从inquirer.js菜单运行一个protractor.jstesting

我陷入了一个问题。 我有一套用protractor.js编写的端到端testing,我用inquire.js做了一个小菜单,我将在其中select要运行的testing。 问题是,我实在找不到任何有关如何将这两个项目实际连接在一起的信息,所以菜单一旦选定就可以调用一个testing。 这里是一个testing样本和我做的菜单: 这是我的量angular器testing: var session = require('../login.js'); describe('The customer view', function() { var physicalPersonRegistration = {}; physicalPersonRegistration.loginTest = function() { it('should Login', function() { browser.ignoreSynchronization = true; browser.get('http://localhost:8080/project'); session.username.sendKeys('admin'); session.password.sendKeys('admin'); session.submit.click(); browser.ignoreSynchronization = false; }); }; //executing tests physicalPersonRegistration.loginTest(); }); 这是我的inquire.js菜单: var inquirer = require("inquirer"); var questions = [ { type: "list", name: […]

在Angular2中保护API密钥

我现在一直在Google上search。 可能是我错过了正确的关键字。 我有以下设置: ExpressJS API(在端口3000上使用pm2运行) Angular2应用程序 – 通过nginx提供 两者都在同一台服务器上运行。 调用api(mydomain / api /)代理127.0.0.1:3000 对于需要授权的api调用,我将使用JWT和用户authentication。 我想要实现的是,我为我的angular2应用程序生成一个令牌,允许/需要进行公共呼叫(例如产品清单)。 当然,我不希望别人通过直接的API调用(盗用令牌)来获取我的产品和价格。 任何帮助赞赏。

部署Angular 2项目时,Azure持续部署在Github上失败

我对Azure和Angular2完全陌生。 目标 使用GitHub设置Azure连续部署。 问题 Azure正在提交存储库上的主分支。 所以这部分是可以的。 但是,由于构build错误,部署失败。 这里是部署细节: 这里是完整的日志: Command: "D:\home\site\deployments\tools\deploy.cmd" Handling .NET Web Application deployment. MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin'. All packages listed in packages.config are already installed. D:\home\site\repository\LearnJS\LearnJS.Web\app\app.component.ts(1,41): error TS2307: Build: Cannot find module 'angular2/core'. [D:\home\site\repository\LearnJS\LearnJS.Web\LearnJS.Web.csproj] D:\home\site\repository\LearnJS\LearnJS.Web\app\app.component.ts(2,46): error TS2307: Build: Cannot find module 'angular2/router'. [D:\home\site\repository\LearnJS\LearnJS.Web\LearnJS.Web.csproj] D:\home\site\repository\LearnJS\LearnJS.Web\app\crisis-form.component.ts(1,25): error TS2307: […]

使用Maven,量angular器和Selenium WebDriver进行集成testing

我们开发了一个Web应用程序,在后端使用Java,在UI中使用Angular,使用Maven作为构build系统。 我一直在尝试使用量angular器来设置自动化的集成testing,并且在Google负载/ StackOverflowing加载之后,仍然无法弄清楚如何实现最终的2端configuration。 Node.js / NPM安装(失败) 我已经尝试使用前端Maven插件来处理Node.js和NPM安装,但是由于我们是在公司防火墙的后面,似乎不可能直接下载任何东西。 虽然它可以从我们的Artifactory下载Node,但是在NPM下载失败(我不明白为什么它甚至会下载它,因为它是Node包的一部分)。 无论如何,我放弃了这个想法,并决定使用本地安装的节点。 启动Tomcat 为e2etesting启动/停止一个Tomcat实例很好地被处理 <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <url>${tomcat.manager.url}</url> <path>/</path> <server>Tomcat</server> </configuration> <executions> <!– Starting Tomcat –> <execution> <id>start-tomcat</id> <phase>pre-integration-test</phase> <goals> <goal>run</goal> </goals> <configuration> <!– Fork the process, otherwise the build will be blocked by the running Tomcat –> <fork>true</fork> <port>${tomcat.port}</port> <systemProperties> <!– We want to use […]

Angular 2快速入门 – 我的应用程序组件不加载

试图学习angular度,所以我已经开始在他们的网站( https://angular.io/guide/quickstart )的TypeScript快速入门教程, 我正在研究Ubuntu 14.04。 我已经按照每一步,最后我没有得到任何错误,但组件不加载。 相反,我所看到的唯一的事情是“加载…”,而不是主要组件“我的应用程序”。 我在浏览器中看到的 index.html : <html> <head> <title>Angular 2 QuickStart</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="styles.css"> <!– 1. Load libraries –> <!– Polyfill(s) for older browsers –> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.js"></script> <script src="node_modules/reflect-metadata/Reflect.js"></script> <script src="node_modules/systemjs/dist/system.src.js"></script> <!– 2. Configure SystemJS –> <script src="systemjs.config.js"></script> <script> System.import('app').catch(function(err){ console.error(err); }); </script> […]

Rxjs如何知道有多less可观察的用户?

当我有一个可观察的多个订阅者,例如: const myInterval = Rx.Observable.interval(500); const subscriptionOne = myInterval.subscribe(val => doSomething()); const subscriptionTwo = myInterval.subscribe(val => doSomething()); 我怎么知道有多less订户仍然注册到myInterval可观察的? 我需要这个信息,例如, 以防万一我忘了取消订阅其中之一的内存泄漏 ?

分离的客户端和服务器的身份验

我已经在客户端创build了angular色2的Web应用程序,并为服务器端创build了具有express框架的NodeJS 。 对于客户端来说,我使用angular-cli生成了在lite-server上运行的项目,所以我的客户端和服务器在两个不同的服务上运行。 我想集成ADFS身份validation。 为了实现身份validation,我使用passport-saml包。 我的服务器端API有一个中间件,需要用户进行身份validation。 当直接到达服务器(没有客户端)时,身份validation过程正常工作。 但是,我无法通过@angular/http访问API 。 我尝试了一个简单的GET请求从服务器(与中间件在终点),结果我得到的身份validation页面没有redirect(我不认为这是核心问题,但实际的实施)。 在服务器和客户端使用单独的服务时,我应该如何正确地实现身份validation?

在node.js上使用systemjs(&Angular 2)

说我有一个foo.ts和app.ts如下: foo.ts: export interface Foo { id: number; label: string; }; app.ts: import {Foo} from './foo' var myfoo: Foo = { "id": 1, "label": "One" }; console.log(JSON.stringify(myfoo)); 在编译之后,如果我在我的tsconfig.json使用"module"="commonjs" ,那么从命令行执行'node app.js'将按预期运行。 切换到追逐,我想要做的是使用我的Foo接口客户端与Angular 2,服务器端与节点。 不方便的是,我在这里build模的Angular 2 quickstart在tsconfig.json "module"="system" 。 尝试运行'node app.js'时,此configuration会导致错误: System.register([], function(exports_1) { ^ ReferenceError: System is not defined` 我已经尝试按照说明在github上使用systemjs与节点,但在这一点上,我只是糖化键,可以使用一些帮助。 我怎么(a)让我的app.ts代码运行在服务器端使用systemjs,或者(b)得到运行commonjs的Angular 2快速启动?

噶将不会运行(socket.io抛出错误)

我有一个Angular 2项目,用Typescript编写。 我正试图让Travis CI成立。 不幸的是,我收到了来自Karma的错误: 丢失socket上的error handling程序。 TypeError:(msg ||“”).replace不是一个函数 预期的行为 我的Travis CI构build完成茉莉花unit testing定义,报告数量运行和成功与失败。 实际行为 这是我的构build日志的输出。 这是完整的生成日志。 另外, 这里是正在构build的完整的github存储库。 [09:39:04] Starting 'client.unit_test'… 05 04 2016 09:39:04.281:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/ 05 04 2016 09:39:04.287:INFO [launcher]: Starting browser Chrome 05 04 2016 09:39:05.519:INFO [Chrome 49.0.2623 (Linux 0.0.0)]: Connected on socket /#7wcOJ3uFvZX-HgZeAAAA with id 49035067 […]