In this lesson we are going to use AngularFire 2 for the first time. We are going to configure the AngularFire 2 module, inject the AngularFire service in our service layer and use it do our first Firebase query: we are going to retrieve a list of ob…
Basic angularFire options: $save, $add and $remove. The way connect firebase: var app = angular.module('app', ['firebase']); var ref = new Firebase(FIREBASE_URI); //create an item storage var items = $firebase(ref); Example: <!DOCTYPE html> <html…
Config AngularFire, we need database and auth module from firebase. import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {RouterModule, Routes} from '@angular/router'; import {AngularFireModule, FirebaseAppConf…
In this lesson we are going to learn how to use AngularFire 2 to query objects, and read them from the Firebase realtime database. const course$: FirebaseObjectObservable<any> = af.database.object('courses/-KT0LsbuhHZGr5F4v7OV'); course$.subscribe((…
Lets see how to query Firebase. First thing, when we do query, 'index' will always help, for both SQL and NoSQL. In Firebase, we can also set index on props, for example we want to set an 'index' on 'courses' --> 'url' prop, we will use 'url' to loca…
import { NgModule } from '@angular/core'; import { AuthService } from './auth.service'; import { AngularFireAuthModule } from 'angularfire2/auth'; import { AngularFirestoreModule } from 'angularfire2/firestore'; @NgModule({ imports: [ AngularFireAuth…
The upload class will be used in the service layer. Notice it has a constructor for file attribute, which has a type of File. This will allows us to initialize new uploads with a JavaScript File object. You will see why this is important in the next…
Updated to AngularFire2 v5.0. One important change is that you need to call .snapshotChanges() or .valueChanges() to get data as Observable back. return this.db.list<Skill>(`skills/${this.uid}`) .snapshotChanges() The problem is when there is no dat…
A simple store implemenet: import { Observable } from 'rxjs/Observable'; import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import 'rxjs/add/operator/pluck'; import 'rxjs/add/operator/distinctUntilChanged'; import {User} from './auth/shared/serv…
import { Injectable } from '@angular/core'; import {RealtimeService} from "../shared"; import {FirebaseListObservable} from "angularfire2"; @Injectable() export class CourseService { courses$: FirebaseListObservable<any>; public…
We cannot allow un-auth user to change the database data as they want, for Firebase, it is easy just need to overwirte the rules: { "rules": { ".read": "true", ".write": "auth != null", "courses"…
前言:记得三月份时下定决心说每天要更新一篇博客,学习点新东西,实践下来发现太不现实,生活中的事情很多,再喜欢也不能让它一件占据生活的全部吧,所以呢,以后顺其自然吧.之前有一篇'初识angular'因为离职找工作等一系列原因,搁置了好久,这次公司新项目要用angular,今早看看,继续写以前的已经无法继续,索性重新开始,有时间再修该之前的吧. 二识angular(基于angular官方文档) 地址:https://angularjs.org/ 一,基础:先看html代码 <!doctype htm…
1.MVVM的看法:我给view里面各种控件也定义一个对应的数据对象,这样,只要修改这个数据对象,view里面显示的内容就自动跟着刷新,而在view里做了任何操作,这个数据对象也跟着自动更新. ViewModel:就是与界面(view)对应的Model.因为,数据库结构往往是不能直接跟界面控件一一对应上的,所以,需要再定义一个数据对象专门对应view上的控件.而ViewModel的职责就是把model对象封装成可以显示和接受输入的界面数据对象. 简单的说,ViewModel就是View与Mode…
AngularJS是那些渴望以动态方式来设计web app的web开发人员最偏爱的框架之一.如果你是一个希望启动AngularJS项目的开发人员,那么你可能需要帮助来挑选出趁手的工具…… 在ValueCoders中,我们做了一番研究以缓和用AngularJS开发的负担.下面是20个最新的用于测试.前端开发.IDE编辑器.文本编辑器.精华库.模块.扩展.代码生成器.Grid工具等的工具. 先按用处奉上我最喜欢的三个AngularJS测试框架: 1.Karma——这是我最喜欢的用于AngularJS…
The idea: This post we are going to learn how to build a Firebase Forage with object related database. Form the pic we can see that there are two object: users and items. This helps to orginzie the data structure better. The way to do this is followi…
Using $firebaseSimpleLogin service. Here we use three methods for login, logout, register and getCurrentUser. Be sure to open the Email and Password configuration on Forge: login.tmpl.html <div class="container" ng-controller="LoginCtrl&…
原文地址:https://blog.angular.io/version-8-of-angular-smaller-bundles-cli-apis-and-alignment-with-the-ecosystem-af0261112a27 Angular 8 - 更小的包,CLI API 以及与生态保持一致 Angular 8 现在发布了!这是跨越整个平台的重要发布,包括框架.Angular Material,与主版本同步的 CLI.该发布改进了应用程序在现代浏览器上的启动时间,提供了开发 C…
不花一分钱,就可以做native应用开发,这在以前是根本不敢想象的事儿.然而在今天,移动开发工具和服务已经五花八门,聪明的开发者只要随心所欲的抓取几个顺手的,就能完成native开发.今天给大家介绍的思路其实很简单: 1. 使用Nitrous.IO云端编程环境,开启Node.JS的box模块.2. 然后使用Github账号连接上Node.JS box.3. 内容部分,可以使用Ionic框架和Web代码,快速开发出我们需要的界面.4. 使用PhoneGap编译出native的Android app…
Angular 是最流行的 Web 应用程序开发框架之一.随着 Angular 7 的发布,它为 Web 开发人员带来了更多功能,包括核心框架.Angular Material.与主要版本保持同步的 CLI 和 工具 链,并且还有了几个主要合作伙伴. 依赖更新TypeScript 3.1       在使用 Angular 7 时,必须使用 TypeScript 的最新版本. RxJS 6.3      Angular 7 添加了最新版本的 RxJs(6.3.3),带来了一些令人兴奋的补充和变更…
Angular 8 - 更小的包 Angular 8 发布 原文地址:https://blog.angular.io/version-8-of-angular-smaller-bundles-cli-apis-and-alignment-with-the-ecosystem-af0261112a27 Angular 8 - 更小的包,CLI API 以及与生态保持一致 Angular 8 现在发布了!这是跨越整个平台的重要发布,包括框架.Angular Material,与主版本同步的 CLI.…
# Angular 2 技能图谱 ## 模块 ### 自定义模块 - 根模块 - 特性模块 - 共享模块 - 核心模块 ### 内置模块 - ApplicationModule 模块 - CommonModule 模块 - BrowserModule 模块 - FormsModule 模块 - ReactiveFormsModule 模块 - RouterModule 模块 - HttpModule 模块 ### 元数据 - providers - declarations - imports…
在逝去的2016后半年,由于项目需要支持数据的快速更新和多用户的高并发负载,我试水SQL Server 2016的In-Memory OLTP,创建内存数据库实现项目的负载需求,现在项目接近尾声,系统运行稳定,写一篇博客,记录一下使用内存数据库的经验. SQL Server 2016的In-Memory OLTP,通俗地讲,是内存数据库,使用内存优化表(Memory-Optimized Table,简称MOT)来实现,MOT驻留在内存中,使用 Hekaton 内存数据库引擎访问.在查询MOT时,…
JSON是一个非常流行的,用于数据交换的文本数据(textual data)格式,主要用于Web和移动应用程序中.JSON 使用“键/值对”(Key:Value pair)存储数据,能够表示嵌套键值对和数组两种复杂数据类型,JSON仅仅使用逗号(引用Key)和中括号(引用数组元素),就能路由到指定的属性或成员,使用简单,功能强大.在SQL Server 2016版本中支持JSON格式,使用Unicode字符类型表示JSON数据,并能对JSON数据进行验证,查询和修改.推荐一款JSON验证和格式化…
内存优化表(Memory-Optimized Table,简称MOT)使用乐观策略(optimistic approach)实现事务的并发控制,在读取MOT时,使用多行版本化(Multi-Row versioning)创建数据快照,读操作不会对数据加锁,因此,读写操作不会相互阻塞.写操作会申请行级锁,如果两个事务尝试更新同一数据行,SQL Server检测到写-写冲突,产生错误(Error 41302),将后后创建的事务作为失败者,回滚事务的操作.虽然MOT事务使用无锁结构(Lock-Free)…
// 1.变量:颜色可做+- // from @nice-blue: #5B83AD; @light-blue: @nice-blue + #111; #header { color: @light-blue; } // to #header { color: #6c94be;} // 2.混入(Mixins),#id,.class的样式直接添加 // from .bordered { border-top: dotted 1px black; border-bottom: solid 2px…
十一.安装sass文件转换为css需要的相关依赖包 npm install --save-dev sass-loader style-loader css-loader loader的作用是辅助webpack将符合条件的源文件转换为对应的目标格式文件.比如index.scss转换成index.css 安装成功后,package.json文件变化如下: 接着,安装extract-text-webpack-plugin,让webpack可以输出css格式的文件 npm install --save-…
Fis3版本:v3.4.22 Fis3的三大特性 资源定位:获取任何开发中所使用资源的线上路径 内容嵌入:把一个文件的内容(文本)或者base64编码(图片)嵌入到另一个文件中 依赖声明:在一个文本文件内标记对其他资源的依赖关系 资源定位 资源定位的能力让我们不在关心资源部署到线上之后去了哪里,变成了什么名字,这些都可以通过配置来指定.而工程师只需要使用相对路径来定位自己的开发资源即可. html中资源定位 对html中的script.link.style.video.audio.embed等标…
[原]FMDB源码阅读(三) 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 FMDB比较优秀的地方就在于对多线程的处理.所以这一篇主要是研究FMDB的多线程处理的实现.而FMDB最新的版本中主要是通过使用FMDatabaseQueue这个类来进行多线程处理的. 2. FMDatabaseQueue使用举例 // 创建,最好放在一个单例的类中 FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath…
Elasticsearch 5.0 关于term query和match query的认识 一.基本情况 前言:term query和match query牵扯的东西比较多,例如分词器.mapping.倒排索引等.我结合官方文档中的一个实例,谈谈自己对此处的理解 string类型在es5.*分为text和keyword.text是要被分词的,整个字符串根据一定规则分解成一个个小写的term,keyword类似es2.3中not_analyzed的情况. string数据put到elasticse…
1. 建库连库 连接MySQL数据库需要安装支持 npm install mysql 我们需要提前安装按mysql sever端 建一个数据库mydb1 mysql> CREATE DATABASE mydb1; mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | mydb1 | | performance_sch…