Tag: 量angular器

使用Typescript的持久性

我目前正在使用Electron(基本上是带有铬的nodejs)加上Angular2 有没有办法在文件中保存打字稿对象? 目前,我将对象保存在json文件中。 问题是所有的对象方法都丢失了 我应该尝试保存__proto__variables吗? 我应该使用框架还是特殊的数据库引擎? 今天我从json文件中读取对象并使用JSON.parseparsing它。 然后我重新分配一个新的对象的所有属性,这是不可扩展的 任何build议是值得欢迎的 提前致谢。 何塞

UNMET PEER DEPENDENCY zone.js@0.7.6

按照https://github.com/AngularClass/angular2-webpack-starter#quick-start中的说明安装angular2-webpack-starter 按照https://universal.angular.io/quickstart/的指示执行npm install body-parser angular2-universal preboot express –save 输出: +– angular2-universal@2.1.0-rc.1 | +– angular2-platform-node@2.1.0-rc.1 | | `– parse5@2.2.3 | +– css@2.2.1 | | +– source-map@0.1.43 | | +– source-map-resolve@0.3.1 | | | +– atob@1.1.3 | | | +– resolve-url@0.2.1 | | | `– source-map-url@0.3.0 | | `– urix@0.1.0 | +– js-beautify@1.6.8 | | +– config-chain@1.1.11 […]

量angular器:在一个js中初始化全局variables,并在其他js中使用相同的variables

我正在使用量angular器来testingangularJS应用程序。 我已经在我的testingjs中声明了一个variables'logDir',并且想在其他js中用它作为全局variables。 //test.js var regex = /(.*automation)/; var result = regex.exec(__dirname); var baseDir = result[0]; var libDir = baseDir + '/lib'; 我想在其他js全局使用libDirvariables。 我是量angular器新手,需要帮助。 如果需要更多的澄清,让我知道。 提前致谢。

将库导入到没有NPM的Angular2 / WebPack项目中

我对Angular2和WebPack是完全陌生的,并且正在为可能非常简单的事情而苦苦挣扎。 我们正在尝试将yFiles for HTML合并到Agular2 / WebPack项目中。 我在@types/yfiles上find并在NPM上导入了types文件。 库的其余部分只能从供应商处获得,而不能在NPM上获得。 这编译正确,但是当我debugging项目时,控制台报告错误: EXCEPTION:未捕获(承诺):错误:./HomeComponent类中的错误HomeComponent – 内联模板:0:0由:未定义的yfiles 错误:./HomeComponent类中的错误HomeComponent – 内嵌模板:0:0由:yfiles未定义 它不是HomeComponent那么多的DiagramComponent它引用有问题。 import { Component, OnInit } from '@angular/core'; @Component({ selector: 'fs-diagram', templateUrl: './diagram.component.html', styleUrls: ['./diagram.component.scss'] }) export class DiagramComponent implements OnInit { private canvas: yfiles.view.CanvasComponent; constructor() { this.canvas = new yfiles.view.CanvasComponent(); } ngOnInit() { } } 文件夹结构如下所示: > root > […]

使用Bunyan和Logentrieslogin打字稿

我想在我的离子应用程序中使用logentries.com设置远程日志logging。 这是从我的package.json摘录: "dependencies": { "bunyan": "^1.8.5", "bunyan-logentries": "^1.2.0", }, "devDependencies": { "@types/bunyan": "0.0.35", "@types/bunyan-logentries": "0.1.30", "typescript": "2.0.9" }, 码 import {createStream} from "bunyan-logentries"; import * as Logger from "bunyan"; // … constructor() { let token = 'xxxxxxxxxxxxxxxxx'; let log = Logger.createLogger({ name: '', streams: [{ level: 'info', stream: createStream({token: token}), type: 'raw' }] }); log.info("Created […]

我在安装angular度cli时遇到问题

我得到以下错误,而我尝试安装angular度cli。 我已经更新了我的节点以及npm,但没有任何工作。

angular度为2的节点,当你在url栏中input路由时,会得到404错误

当使用angular度为2的节点时,有奇怪的事情发生,我想修复。 基本上,如果我要在URL中input路由,例如浏览器url栏中的localhost:3000/about 。 我不能得到/家。 但是,当点击导航栏,我有相同的链接/左右。 它工作得很好。 我知道这是一个节点的问题,因为最初,我使用开发服务器这个错误没有发生与angular2。 angular2路线 const routes: Routes = [ { path: '', redirectTo: 'home', pathMatch: 'full' }, { path: 'home', component: HomeComponent}, { path: 'private', component: PrivateComponent}, { path: 'title', component: TitleComponent}, { path: 'shop', component: WelcomeComponent }, { path: 'about', component: AboutComponent }, { path: 'login', component: LoginComponent}, { path: […]

通过Express格式错误从Node API向客户端(Angular2)提供的身体响应

当我的Angular2组件发出一个请求来获取我的假模型数据对象时,它就像这样返回: _body: "[↵ {↵ "id": 0,↵ "title": "2017 Oscars",↵ "graphic": "https://wikitags.com/images/OscarsBanner.png",↵ 我期待的是一个像这样的数组: [ { id: 0, title: '2017 Oscars', graphic: '/images/OscarsBanner.png', categorycards: [ [Object], [Object], [Object], [Object] ] }, { id: 1, title: '2017 Super Bowl', graphic: '/images/SuperBowlBanner.png', categorycards: [ [Object], [Object], [Object], [Object] ] }, { id: 2, title: 'What people are talking about', […]

编译错误:找不到模块'util'

我是angular2上的新程序员。 我有问题时,与angularcli编译。 我通过angular度cli生成angular度2项目。 我试图通过导入模块像这样在node_modules/@types/node上使用debuglog模块: import {debuglog} from "util"; 我使用Webstorm IDE进行开发,IDE不会警告或错误导入。 我检查并findpath中的debuglog模块: myproject/node_modules/@types/node/index.d.ts 。 我的代码有什么问题? 有任何build议修复它? Github上的项目: https : //github.com/sinhpn92/angular2-example-types-node 环境版本: @angular/cli: 1.0.0-rc.1 node: 7.7.1 os: darwin x64 @angular/common: 2.4.9 @angular/compiler: 2.4.9 @angular/core: 2.4.9 @angular/forms: 2.4.9 @angular/http: 2.4.9 @angular/platform-browser: 2.4.9 @angular/platform-browser-dynamic: 2.4.9 @angular/router: 3.4.9 @angular/upgrade: 2.2.4 @angular/cli: 1.0.0-rc.1 @angular/compiler-cli: 2.4.9

gulp-clean:不能删除当前工作目录之外的文件

当我在我的angular2项目中运行命令 咕噜咕噜咕噜咕噜咕噜。 请任何人解释这个问题的根源是什么,或者这个有什么问题。我会高度赞赏吗?