-
Notifications
You must be signed in to change notification settings - Fork 0
/
content.json
1 lines (1 loc) · 4.1 KB
/
content.json
1
[{"title":"node使用笔记","date":"2017-03-22T03:54:08.000Z","path":"2017/03/22/node使用笔记/","text":"1. npm install 迷之失败主要报错内容如下: 123456789npm ERR! Darwin 16.4.0npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "gulp-cli"npm ERR! node v6.7.0npm ERR! npm v3.10.3npm ERR! code ETIMEDOUTnpm ERR! errno ETIMEDOUTnpm ERR! syscall connectnpm ERR! Cannot read property 'path' of null 公司网络最近很差,开始怀疑公司网络=》终端使用代理失败=》终于找到类似问题,解决方案如下:npm config set registry http://registry.npmjs.org/ 难道是因为https挂了??","tags":[{"name":"node","slug":"node","permalink":"http://tingtingli911.github.io/tags/node/"}]},{"title":"初学ionic","date":"2016-12-05T12:30:33.000Z","path":"2016/12/05/初学ionic/","text":"1. Ionic2 多语言支持看了半天的Angular2官方文档,没有搞太明白,主要原因是官方使用的是SystemJs而不是Webpack。经过曲折的经历,终于找到了一个非常适合Ionic2翻译的插件--ng2-translate。使用起来非常简单,尤其是对于ionic。(附上官方文档链接:http://ionicframework.com/docs/v2/resources/ng2-translate/) 安装ng2-translate: npm install ng2-translate --save 修改/src/app/app.module.ts加入以下代码: 12345import {HttpModule, Http} from '@angular/http';import { TranslateModule, TranslateStaticLoader, TranslateLoader } from 'ng2-translate/ng2-translate';export function createTranslateLoader(http: Http) { return new TranslateStaticLoader(http, 'assets/i18n', '.json');} 更改import部分: 123456789@NgModule({imports: [ TranslateModule.forRoot({ provide: TranslateLoader, useFactory: (createTranslateLoader), deps: [Http] })]}) 修改/src/app/app.component.ts 12345678910111213141516171819import {TranslateService} from 'ng2-translate';@Component({ templateUrl: 'app.html'})export class MyApp { rootPage = HomePage; constructor(platform: Platform, translate: TranslateService) { platform.ready().then(() => { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native things you might need. StatusBar.styleDefault(); Splashscreen.hide(); }); translate.setDefaultLang('cn'); translate.use('cn'); }} 使用方法使用方法很简单,参考ng2-translate介绍即可","tags":[{"name":"Angular2","slug":"Angular2","permalink":"http://tingtingli911.github.io/tags/Angular2/"},{"name":"JavaScript","slug":"JavaScript","permalink":"http://tingtingli911.github.io/tags/JavaScript/"}]},{"title":"探索Angular2--笔记","date":"2016-10-14T07:25:35.000Z","path":"2016/10/14/探索Angular2--笔记/","text":"学习笔记 元数据:告诉Angular如何处理一个类,例如”@Component”装饰器后面的类被视作一个组件,传给装饰器的参数(配置项)就是元数据。它是用来指导Angular的行为的。 代码规范 所有service都添加@Injectable() 实际使用技巧 可选依赖 @Optional() 1234567import { Optional } from '@angular/core';constructor(@Optional() private logger: Logger) { if (this.logger) { this.logger.log(some_message); }} s","tags":[{"name":"Angular2","slug":"Angular2","permalink":"http://tingtingli911.github.io/tags/Angular2/"},{"name":"JavaScript","slug":"JavaScript","permalink":"http://tingtingli911.github.io/tags/JavaScript/"}]},{"title":"Hello World","date":"2016-06-22T04:26:59.000Z","path":"2016/06/22/hello-world/","text":"Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new \"My New Post\" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment","tags":[]}]