Link: https://angular.io/docs/js/latest/api/core/OnInit-interface.html, https://www.youtube.com/watch?v=bY92HFyaBvo export interface OnInit exported from angular2/core defined in angular2/src/core/linker/interfaces.ts (line 79) Implement this interfa…
ajax获取数据示例: 示例1 通过ajax获取txt文件里面的内容示例: <html> <head> <title>Ajax at work</title> <script type="text/javascript"> var XMLHttpRequestObject = false; if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpReques…
配置zookeeper集群,一开始配置了两台机器server.1和server.2. 配置参数,在zoo.cfg中指定了整个zookeeper集群的server编号.地址和端口: server.1=10.10.16.151:2888:3888 server.2=10.10.16.234:2888:3888 然后为这两个个节点创建对应的编号文件,在/tmp/zookeeper/data/myid文件中.如下: 在server.1=10.10.16.151机器上执行: echo 1 > /tmp/z…
We will learn how to fire up an async request when the route changes. A mock server data: /** /api/index.js * Created by wanzhen on 7.6.2016. */ import { v4 } from 'node-uuid'; // This is a fake in-memory implementation of something // that would be…
===>首先需要使用https<===https://ruby.taobao.org/ 第一步 下载http://pan.baidu.com/s/1kU0rxtH 复制到ruby安装的根目录 第二步 添加系统环境变量: SSL_CERT_FILE=ruby的根目录加\cacert.pem(类似C:\Ruby22-x64\cacert.pem) 第三步 关闭命令行,重新打开,重新键入 gem sources -a https://ruby.taobao.org/…
When a Todo property updates, you still must create a new Array of Todos and assign a new reference. This lesson walks you through refactoring from the current approach to the immutable approach. TodoItemRender.ts: import {Component, Input, ViewEncap…
Kafka消费程序间歇性报同一个错: 上网没查到相关资料,只好自己分析.通过进一步分析日志发现,只有在拉取某一个特定的topic的数据时报错,如果拉取其他topic的数据则不会报错.而从这个异常信息来看是拉取数据时进行类似CRC校验时,校验结果不正确.所以,感觉可能是数据损坏.于是联系了OP(我们单位开发人员不去现场操作),把疑似出错的那个topic.partition和offset信息发给他,他检查了一下Kafka,果然是数据损坏了(处于保护机密考虑,把分区名字那里模糊处理一下): 由于Kaf…
<!-- index.html --> <html> <head> <!-- Do _not_ rely on this URL in production. Use only during development. --> <script src="//netflix.github.io/falcor/build/falcor.browser.js"></script> <script> var mo…
1.公共服务 //test.service.ts import {Injectable} from '@angular/core'; import {Subject} from 'rxjs/Subject'; @Injectable() export class TestService{ missionAnnouncedSource = new Subject(); missionAnnounced$:any = this.missionAnnouncedSource.asObservable(…
使用npm安装ngx-loading模块 npm install --save ngx-loading 在app.module.ts中导入模块 import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { NgxLoadingModule } from 'ngx-loading'; @NgModule({ ... imports: [ ..…