firebase ionic

刚用ionic + fireangular + firebase + fusejs + nvd3 写了个投票软件


ionic是写hybrid app用的,是个css样式,跟bootstrap类似,安装好后跑到www目录下只有三个东西:html js css,操作这三个就好了。后端自己搞定。

firebase是个云服务,我用了两个主要功能:nosql 数据库以及用户验证,跟ionic 特别配。

firebase是免费的,上官网就能注册个账号。

 在自己的app里的js里,var ref = new Firebase("https://tuttut.firebaseio.com");这就创建了个对象了。

用ref.on('value', function(data) {} 来监听数据

返回的data 用val() 转换一下,由于firebase 暂时不支持数组,所以存数组的格式是{{key:value},{key2:value2},{key3:value3}},另外如果key是0,1,2,3的话它能聪明的识别是数组。


然后通过forEach的方式建立个本地数组。


创建用户:ref.createUser({})

获得用户: var authUser=ref.getAuth();


大概就这样了。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Build Mobile Apps with Ionic 2 and Firebase: Hybrid Mobile App Development 27 May 2017 | English | ISBN-10: 1484227360 | 276 pages | PDF | 2.9 Mb Learn to build hybrid mobile apps using Ionic and Firebase. You'll build a Hacker News client app, which can view top stories in Hacker News, view comments of a story, add stories to favorites, etc. This introductory guide covers the whole cycle of hybrid mobile apps development. It's organized around implementing different user stories. For each story, this book not only talks about how to implement it but also explains related Ionic and Firebase concepts in detail. Using Apache Cordova, developers can create a new type of mobile app—a hybrid mobile app. Hybrid mobile apps actually run in an internal browser inside a wrapper created by Apache Cordova. With hybrid mobile apps, developers can have one single code base for different platforms. Developers also can use their existing web development skills. The Ionic framework builds on top of Apache Cordova and provides out-of-box components which make developing hybrid mobile apps much easier. Ionic uses Angular as the JavaScript framework and has a nice default UI style with a similar look and feel to native apps. Firebase is a realtime database which can be accessed in web apps using JavaScript. With Build Mobile Apps with Ionic 2 and Firebase you'll discover that just need to develop front-end code, there's no need to manage any back-end code or servers. What You'll Learn Create content-based Ionic mobile apps Use advanced features of the Ionic framework Use Firebase as a mobile app’s back-end storage Build, test, and continuously delivery Ionic mobile apps Publish and analyze Ionic mobile apps Who This Book Is For Front-end developers and mobile app developers

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值