Tag: 量angular器

打包一个nodejs c ++共享库

我做了一个nodejs共享库,现在我想打包它来部署它。 我希望能够与包装的angular2应用程序使用它感谢webpack。 共享库位于build / Release文件夹中。 如何继续在webpack中很好地打包? 或者是一个特定的package.json声明? 看看nodejs文档,dll名称使用扩展名.node( https://nodejs.org/api/addons.html#addons_loading_addons_using_require ) webpack节点加载器可能有帮助吗? https://webpack.js.org/loaders/node-loader/ 我将使用服务器端渲染,否则这将是不可能的。 问候,Steph

在Angular2 + Webpack中使用templateUrl的相对path

import {Component} from 'angular2/core'; @Component({ selector: 'app', styleUrls: ['./app.component.less'], templateUrl: './app.component.html' }) export class AppComponent { name:string = 'Demo' } 当使用templateUrl和styleUrls的相对path时,我得到:错误404,找不到文件: zone.js:101 GET http://localhost/app.component.html 404(Not Found) 代码: https : //github.com/Dreampie/angular2-demo 我觉得这是不好的devise,因为在不同的情况下可能会build立目录不一样,我可以把它改成相对的当前path吗? raw-loader可以解决这个问题,但是html-loader , less-loader不能用于template , styles ,它只能在string工作,所以为什么不把它们支撑起来呢? import {Component} from 'angular2/core'; @Component({ selector: 'app', styles: [require('./app.component.less')], template: require('./app.component.html') }) export class AppComponent { name:string = […]

angular2快速入门只显示Loading ..而不是index.html的内容

第一次使用angular2,按照5分钟快速入门指南中的说明进行angular度2。 一切运行良好,意味着运行npm start没有错误 npm开始图像 但是当我打开 本地主机:3000 它显示正在加载…不期望的文本。 根据这个例子index.html的内容应该反映在这个。 在控制台中有错误: 例外:TypeError:无法设置null属性的'endSourceSpan' main.ts 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: 'My first Angular 2 App</h1>' }) export class AppComponent {} 的index.html <html> <head> <title>Angular 2 QuickStart</title> <meta charset="UTF-8"> <meta name="viewport" […]

如何解决npm“UNMET PEER DEPENDENCY”

我有我的package.json文件的问题。 它应该正常工作,因为我使用其他项目中的大多数节点模块,但我有下面的package.json : "dependencies": { "@angular/common": "^2.0.0-rc.1", "@angular/compiler": "^2.0.0-rc.1", "@angular/core": "^2.0.0-rc.1", "@angular/platform-browser": "^2.0.0-rc.1", "@angular/platform-browser-dynamic": "^2.0.0-rc.1", "@angular/router": "^2.0.0-rc.1", "angular2-in-memory-web-api": "0.0.7", "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" }, "devDependencies": { "body-parser": "^1.15.1", "express": "^4.13.4", "jsonwebtoken": "^6.2.0", "mongoose": "^4.4.15" } 他们应该都运行良好,因为所有的依赖关系存在,因为angular度现在在rc.4和rxjs在5.0.0-beta.10。 但是我得到3个未满足的依赖关系 npm install 'rxjs@5.0.0-beta.10' 'rxjs@5.0.0-beta.6' '@angular/core@2.0.0-rc.1' 我也得到这些警告: npm WARN @angular/core@2.0.0-rc.4 requires […]

从Angular发送电子邮件2

如何从angular度2应用程序发送电子邮件? 我正在主持一个关于firebase的Angular 2应用程序。 我想发送一个联系表格作为电子邮件。 理想情况下,我的解决scheme将使用Nodejs,但我愿意使用任何能够正确完成工作的任何东西。 下面是我的应用程序的细分。 客户端进度 这是我的forms: <!– contact-form.component.html –> <form [formGroup]="formService.contactForm" (ngSubmit)="formService.onSubmitForm()"> <input type="text" formControlName="userFirstName"> <label>First Name</label> <input type="text" formControlName="userLastName"> <label>Last Name</label> <button type="submit">SUBMIT</button> </form> 这是我的联系表单组件: // contact-form.component.ts import { Component } from '@angular/core'; import { ContactFormService } from './contact-form.service'; @Component({ selector: 'contact-form', templateUrl: './contact-form.component.html', styleUrls: ['./contact-content.component.css'], providers: [ContactFormService] }) export class ContactFormComponent […]

使用量angular器给出错误进行端到端testing

我正在尝试通过angularjs.org的angular-phonecat中的教程。 在stetp三,我得到错误的量angular器端到端testing。 这是错误代码。 Using ChromeDriver directly… Cannot read property 'matcherFn_' of undefined [launcher] Runner Process Exited With Error Code: 1 npm ERR! angular-phonecat@0.0.0 protractor: `protractor test/protractor-conf.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular-phonecat@0.0.0 protractor script. npm ERR! This is most likely a problem with the angular-phonecat package, npm ERR! […]

什么是angular2中使用system.config.js文件?

var map,packages,var config做什么? 还解释了map和package对象的所有configuration属性。 有没有可用的configuration文件? 这是我的系统configuration文件 /** * System configuration for Angular samples * Adjust as necessary for your application needs. */ (function (global) { System.config({ paths: { // paths serve as alias 'npm:': 'node_modules/' }, // map tells the System loader where to look for things map: { // our app is within the […]

ExpressJS与AngularJS路由配对,没有链接上的hashtag

我试图在我的ExpressJS服务器上实现路由function。 http://localhost:3000/app/sub_one http://localhost:3000/app/sub_two 不幸的是,我能够在应用程序名称和模块之间使用#作为前缀。 我一直在寻找解决scheme,似乎这个代码会做我的angular度configuration – $locationProvider.html5Mode(true); 。 但是,执行和调整链接,访问以下链接返回一个不寻常的行为。 http://localhost:3000/app/sub_one => Cannot GET /app/sub_one http://localhost:3000/app/sub_two => Cannot GET /app/sub_two 我可能有这样的直觉,问题是我的server.js路由。 var port = 3000; var express = require("express"); var morgan = require("morgan"); var server = express(); server.use(morgan("tiny")); server.use("/app", express.static(__dirname + "/app")); server.use("/bower_components", express.static(__dirname + "/bower_components")); server.listen(port, function() { console.log("Node server initialized. Server's port: " + […]

Angular2与TypeScript:声明预期编译器错误@component后

我得到这种错误,尽pipe我从angular2 / core导入组件应该是它的来源是文件不是通过npm安装下载或我的节点需要升级 这是我的文件 import {bootstrap} from 'angular2/platform/browser'; import {Component, View} from 'angular2/core'; @Component({ })

Angular 2 cli与Express js

我想使用快速js w / node js作为我的angular度2项目的服务器。 我正在看教程集成快速js w /angularcli(我跟着这个和这个 ),我没有运气。 有没有人有任何build议如何做到这一点? 目前,我有一个新的项目了w / cli只是说“应用程序的作品! 并希望尝试使用快速而不是使用精简版服务器。 任何帮助表示赞赏!