Tag: 量angular器

如何将外部库附加到量angular器configuration文件?

这是图书馆: //library.js var exports = module.exports = {}; exports.login = function(user_login, user_password) { var input; input = element(by.model('loginInfo.login')); input.sendKeys(user_login); expect(input.getAttribute('value')).toBe(user_login); input = element(by.model('loginInfo.password')); input.sendKeys(user_password); expect(input.getAttribute('value')).toBe(user_password); browser.sleep(1000); browser.driver.actions().sendKeys(protractor.Key.ENTER).perform(); browser.sleep(1000); }; 这是我的configuration文件: //config.js var lib = require("./library.js"); exports.config = { directConnect: true, onPrepare: function() { browser.driver.manage().window().maximize(); }, // Capabilities to be passed to the webdriver instance. capabilities: […]

无法在angular度示例项目上运行testing

我已经克隆了Angular Material-Start项目。 正如文件所述: 运行npm run tests来启动所有的Karmaunit testing。 但是这个提议给了我一个错误: npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\\DevSoft\\NodeJs\\node.exe" "C:\\Users\\Taras\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "tests" npm ERR! node v5.7.1 npm ERR! npm v3.8.9 npm ERR! missing script: tests npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <https://github.com/npm/npm/issues> npm ERR! Please include the following […]

Angular 2 Login指令和location.createComponent

我在我的angular度应用程序上实现一个login系统。 我在这里find了一个很好的资源。 但是在自定义的RouterOutlet指令中有一个错误,如下所示: import { ElementRef, DynamicComponentLoader, AttributeMetadata, Directive, Attribute } from '@angular/core'; import { Router, RouterOutlet, ComponentInstruction } from '@angular/router-deprecated'; import { UserService } from './user.service'; @Directive({ selector: 'router-outlet' }) export class LoggedInRouterOutlet extends RouterOutlet { publicRoutes: Array; private parentRouter: Router; private userService: UserService; constructor( _elementRef: ElementRef, _loader: DynamicComponentLoader, _parentRouter: Router, @Attribute('name') nameAttr: string, […]

移动到Angular2 RC2时TS2300:重复的标识符

所以,当从Angular2 RC1移动到RC2时,我更改了我的package.json文件,以包含更新的“ quickstart ”package.json示例中显示的所有依赖项 – 使我的package.json文件的依赖项部分如下所示: "dependencies": { "@angular/common": "2.0.0-rc.2", "@angular/compiler": "2.0.0-rc.2", "@angular/core": "2.0.0-rc.2", "@angular/http": "2.0.0-rc.2", "@angular/platform-browser": "2.0.0-rc.2", "@angular/platform-browser-dynamic": "2.0.0-rc.2", "@angular/router": "2.0.0-rc.2", "@angular/router-deprecated": "2.0.0-rc.2", "@angular/upgrade": "2.0.0-rc.2", "core-js": "^2.4.0", "bootstrap": "^3.3.6", "es6-shim": "^0.35.0", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.6", "systemjs": "0.19.27", "zone.js": "^0.6.12" }, 然后,我运行npm install来获得新的热度。 这返回了无数的错误,但焊接我最终得到了似乎可能工作的东西。 当我去运行我的npm start我迎接了这个: 与types和TS有关的大量错误:各种位置的2300重复标识符错误。

为什么有些软件包不能在angular度2安装时进入供应商文件夹

我刚刚用angular色2build立了一个基础项目。 当我做一个节点安装 – 保存材料devise项目的文件是在node_modules和dist /供应商。 但是,当我安装angular2-localstorage只有一个文件夹在node_modules这是不是networking访问。 在网上一些东西后,我的映射的build议是 const map: any = { '@angular2-material': 'vendor/@angular2-material', 'angular2-localstorage': 'node_modules/angular2-localstorage' }; 这为我的本地存储生产404,材料工作正常。 我错过了什么吗? 我如何获得本地存储的工作。 此外。 node_modules中的本地存储文件夹只有一个ts文件而不是一个js文件。 谢谢

量angular器 – 如果条件元素是可见的如何添加如此跳过这个testing用例否则做下面的动作

我试图给2个替代用例添加一个“if”条件, 第一个是如果它存在用户,所以它应该在屏幕上寻找“idan + free@gmail.com”string,跳到testing用例到下一个, ELSE –执行以下操作。 testing用例 – describe ('Production – New Free Account Test Case', function() { var EC = protractor.ExpectedConditions; var dashboardBtn = element(by.xpath('//div/md-sidenav/f-main-menu/div[1]/ul[1]/li[1]/button/div/div[1]/md-icon')); var noActivation = element(by.linkText("idan+free@gmail.com")); beforeEach(function() { browser.ignoreSynchronization = true; }); afterEach(function() { browser.ignoreSynchronization = false; }); it ('Production – Free Account – Activation', function() { browser.wait(EC.elementToBeClickable(dashboardBtn), 30000); dashboardBtn.click(); browser.wait(EC.visibilityOf(element(by.css("div.task-header.font-smd.task-clickable.ng-binding.flex"))), […]

有关脚本与npm / gulp集成的解释

我正尝试使用TypeScript,NPM和gulp与Visual Studio 2015一起安装Angular2快速入门指南的工作项目。 (Angular2 2.0.0-rc.3,TypeScript 1.8.10,npm 3.6.0和gulp 3.9.1) 根据互联网上的指南,有一些我不是很了解,有一个解释将是非常有帮助的。 NPM允许我们获得我们需要加载到我们的应用程序的最新模块。 这意味着我需要安装与package.json文件的依赖关系如下: "dependencies": { "@angular/common": "2.0.0-rc.3", … "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.6", "systemjs": "0.19.27", "zone.js": "^0.6.12" }, … 一旦安装,我需要使用gulp将这些文件放到我的根文件夹(wwwroot)中,这非常合理。 之后,我需要根据我的应用程序需要configurationsystemJS,以便知道从何处获取要加载的文件。 然后,在快速入门之后,我需要设置脚本来导入我的index.html文件。 我不明白为什么我们手动导入这3个脚本,而我们可以在systemJSconfiguration文件中设置它们? (我在谈论这些: node_modules /核心JS /客户/ shim.min.js node_modules /反映元数据/ Reflect.js node_modules / zone.js / DIST / zone.js ) 只是因为这是一个样本项目,所以这样做很好,还是有更好的理由呢? 我认为这只是因为我们需要这些单个文件,而像@angular这样的软件包包含很多使用systemJS更容易pipe理的文件? 我知道这意味着我对这个主题知之甚less,任何帮助都会很好。 我读过这个链接( https://angular.io/guide/quickstart ),这帮了我一些,但我想我错过了那里的东西… 谢谢, 亚历克斯

使用Angular2 Typescript和ServerJS访问.ENV属性

我一直在通过Angular2快速入门和教程,现在我试图设置从一个活的REST Api拉数据。 我需要通过Api调用authentication参数,我正在阅读的一切,我应该把这些参数到ENVvariables。 我无法弄清楚我应该怎么做。 我已经在我的本地服务器上创build了一个.env文件,我已经使用NPM将dotenv安装到我的项目中,但是我找不到关于如何使用dotenv的示例,似乎与我使用的TypeScript导入语法至。 这是我的main.ts: import { } from 'dotenv/config'; import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component'; bootstrap(AppComponent); 和一个示例app.component.ts: import { Component } from '@angular/core'; @Component({ selector: 'my-app', template: ` <h1>Up and running!</h1> <p>Do not show this at home: {{process.env.TWITTER_CONSUMER_KEY}}</p> `, styleUrls: ['style.css'] }) export class AppComponent { } […]

如何在Bamboo CI中运行量angular器

我试图在Bamboo CI中运行我的量angular器testing用例,但是它会引发安装错误。 我能够使用npm任务来安装节点模块,但不知何故,我无法在我的竹子计划中安装和运行量angular器。 有没有不同的方式做,或者我做错了什么。 请从我的竹子计划附上快照: Npm安装 量angular器任务 而我的错误日志如下 /tmp/RDMPDEV-MAP-JOB1-91-ScriptBuildTask-6009702493071779000.sh: line 1: protractor: command not found 请指教

我在使用npm install for angular 2时遇到了麻烦

这是我在cmd提示符下的错误: npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue > angular2-quickstart@1.0.0 postinstall C:\Users\hp\Desktop\angular2-seed > typings install 'typings' is not recognized as an internal or external command, operable program or batch file. npm WARN optional Skipping failed optional dependency /chokidar/fsevents: npm WARN notsup Not compatible with your […]