Tag: 量angular器

在调用AppComponent.ts之前,Angular 2的起点是什么?

我想在angular度2的应用程序的起点做一些事情,但我无法得到这一点。 请帮助我,如果任何人知道这一点。 提前致谢。

了解npm的“skippingAction模块在一个符号链接模块”

我试图强制使用npm的package.json selenium webdriver和量angular器版本的目的,但我得到以下错误信息: npm WARN install Couldn't install optional dependency: Unsupported npm WARN skippingAction Module is inside a symlinked module: not running add lru-cache@2.7.0 node_modules/findup-sync/node_modules/minimatch/node_modules/lru-cache npm WARN skippingAction Module is inside a symlinked module: not running add sigmund@1.0.1 node_modules/findup-sync/node_modules/minimatch/node_modules/sigmund npm WARN skippingAction Module is inside a symlinked module: not running add async@0.9.2 node_modules/grunt-protractor-runner/node_modules/async npm WARN […]

Angular2的自定义渲染器

我正在尝试使用Angular2的自定义渲染器。 我已经build立了一个简单的示例项目 ,我想在Node.js上运行一个最小的Angular2应用程序( AppComponent )。 我已经实现了一个自定义的DomAdapter和一个自定义的渲染器 (只是一个应该login到控制台的虚拟),然后我尝试在一些自定义引导代码中将所有东西连接在一起。 目前,我遇到以下错误消息: Error: No precompiled component AppComponent found at new BaseException (/home/ralf/git/node-angular-example/node_modules/angular2/src/facade/exceptions.js:15:23) at Compiler_.compileInHost (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/linker/compiler.js:47:19) at DynamicComponentLoader_.loadAsRoot (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/linker/dynamic_component_loader.js:101:31) at di_1.provide.useFactory (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/application_ref.js:29:47) at Injector._instantiate (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:763:27) at Injector._instantiateProvider (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:714:25) at Injector._new (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:703:21) at InjectorInlineStrategy.getObjByKeyId (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:216:33) at Injector._getByKeyDefault (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:899:37) at Injector._getByKey (/home/ralf/git/node-angular-example/node_modules/angular2/src/core/di/injector.js:845:25) 有人可以解释这是什么意思,缺less什么? 更新: Tobias Bosch指出, COMPILER_PROVIDERS失踪了。 但是,添加它们后,我得到另一个错误: Error: DI Exception at […]

为什么Angular 2不加载默认的应用程序根组件?

我试图通过angularCLI生成Angular应用程序,但它似乎像默认的app-root组件不加载。 需要说的是,我正在使用angular应用程序和快递服务器之间的连接代理,并且我正在同时运行两个脚本: node bin/www express / node.js启动和ng serve –proxy-config proxy.config.json用于启动Angular并创build代理连接的ng serve –proxy-config proxy.config.json ,它看起来像这样(package.json的一部分): "scripts": { "start": "concurrently –kill-others \"node bin/www\" \"ng serve –proxy-config proxy.config.json\"" } 索引页面加载正常,但似乎app-root组件(默认组件,它是从angularCLI ng new创build的)不加载: 这里是我的node.js / express use s和一个路由: var express = require('express'); var router = express.Router(); var app = express(); var path = require('path'); app.use(express.static('./src/client/')); app.use(express.static('./')); app.use(express.static('./tmp')); app.use('/*', express.static(path.resolve('src/client/index.html'))); […]

Uncaught TypeError:useValue,useFactory,数据是不可迭代的! Angular 4 cli项目错误

我是Angular 4的新手,我刚刚创build了一个Angular Cli的项目,我得到了错误 Uncaught TypeError: useValue,useFactory,data is not iterable! 我无法解决它。 我安装并重新安装了cli,我只是想知道如何解决它。 我所做的只是 ng new myprj mkdir myprj ng serve

当Angular不可用时,如何等待一个元素与量angular器可见?

我有一个用于量angular器testing的login函数,它看起来像这样: var config = require("../helpers/config.js"); var login = function() { browser.driver.get(config.dsp.url); browser.driver.findElement(by.name("userName")).sendKeys(config.dsp.user); browser.driver.findElement(by.name("password")).sendKeys(config.dsp.password); return browser.driver.findElement(by.name("submit")).click().then(function() { return browser.driver.wait(function() { return browser.driver.isElementPresent(browser.driver.findElement(by.className("sample-class-name"))); }, 360000); }); } module.exports = login; 我不能使用任何量angular器特定的钩子,因为在这个页面上没有使用Angular,所以我必须使用底层的webdriver API。 问题是,我似乎无法弄清楚如何等待,直到一个元素是可见的使用这个包装的webdriver对象。 任何帮助,将不胜感激。

Express-session和express-socket.io-session在angular2 / typecript环境中不起作用

所以我有一个script.js设置服务器,如下所示: var io_session = require("express-socket.io-session"); var e_session = require("express-session")({ secret: "a-secret", resave: true, saveUninitialized: true }); (…) //this block is the last "io.use" before the socket logic (io.on("connection")) io.use(io_session(e_session,{ autoSave: true })); 在我的typecript / angular2前端环境中使用下面的种子https://github.com/NathanWalker/angular2-seed-advanced我使用Http类在多个服务/组件中执行http请求。 然而,当我尝试再次请求服务器的东西,我尝试logging用户会话,什么都没有logging…我不知道为什么会发生这样的事情,不仅用户的会话不被保留,而且会话不是从http共享到套接字层系统(很明显,如果它没有被创build,它也不被共享)。 有人知道这里可能是错的吗? 我可以提供更多的信息,如果需要,但我真的不知道什么是失踪…非常感谢您的帮助。

我如何在Angularjs量angular器中使用系统环境variables?

我的计划是将用户名和密码存储为系统环境variables,并将其引用到Angularjs量angular器configuration文件中。 我在/etc/environment定义了variables。 这是我迄今为止所尝试的: params: { login: { user: $E2E_USER, pass: $E2E_PASS } } 我也试过这个: params: { login: { user: process.env.E2E_USER, pass: process.env.E2E_PASS } } 任何帮助将非常感激!

如何使用module.exports并需要量angular器testing?

我想在我的e2etesting中使用PageObject模式,但我得到一个消息,该模块没有find(错误:无法find模块InsuredSearchPage) 在/acceptance/insured/search/SearchPage.js中 我有以下 enter code here var InsuredSearchPage = (function () { 'use strict'; function InsuredSearchPage() { var searchButton = element(by.id(searchFormBtn)); var page = { search: search }; return page; function search() { searchButton.click(); } } return InsuredSearchPage; })(); module.exports = InsuredSearchPage; 并在testing(即相同的文件夹),我有这个 var InsuredSearchPage = require("InsuredSearchPage"); 当我运行testing时,我得到“错误:找不到模块InsuredSearchPage”。 我究竟做错了什么?

服务工作者推送Angular2的通知

我试图拼凑通过服务工作者给用户推送通知的一般工作stream程。 我遵循这个 Google Developers服务人员推送通知教程,并且正在考虑如何在基于小型用户的Web应用程序中实现这种事情。 在我看来,支持推送通知的Web应用程序的一般工作stream程如下所示: 客户端访问应用 服务工作者产生推送通知端点 客户端将端点发送到服务器 服务器将端点与生成端点的当前用户相关联 每当您的应用程序会说通知值得发生时,服务器就会抓取与该用户关联的推送通知端点,并触发该通知端点向任何用户设备发送推送通知(可能在Chrome 50+等) 基本上我只是想确认一下我的这个技术的一般实现思路是否准确,否则如果我缺less一些东西的话会得到反馈。