第八章,Firebase,解释了 Firebase,这是谷歌的产品,允许您拥有后端作为服务。Firebase 让您专注于构建 Angular 应用程序,同时它会处理几乎所有其他事情。最好的部分是 Firebase 的反应性,这使得像聊天应用程序和协作应用程序一样轻松创建。 第九章,路由,解释了路由的概念,这样您就可以轻松扩展您的应用程序。 第十章,A...
firebaseConfig), AngularFireDatabaseModule ], // ... }) export class AppModule { } 确保你的environment.firebaseConfig包含了正确的Firebase项目配置。 使用Geofire进行地理空间查询 在你的服务或组件中,你可以使用Geofire来进行地理空间查询: 代码语言:javascript 复制 import { Injectable } from '@angular/...
步骤2:配置 Firebase 在Firebase 控制台中创建一个 Firebase 项目,然后获取 Firebase 配置对象。将此配置添加到 Angular 环境文件中: // src/environments/environment.ts export const environment = { production: false, firebase: { apiKey: "your-api-key", authDomain: "your-auth-domain", projectId: "yo...
databaseURL: 'https://FIREBASE_PROJECT_ID.firebaseio.com', }; You can fight the Firebase configuration parameters in the Firebase Settings. Back to the Firebase console, click the Gear button and Project Settings. If there's no web API key, click the </> button to add the web ...
感谢大家,我终于能够用这几行代码从firebase实时数据库中查询每个用户的提交了。 代码语言:javascript 运行 AI代码解释 getCurrentUserOrder() { return this.afAuth.authState.subscribe(user => { if(user) { this.userId = user.uid; console.log(user.uid) console.log(user.email) } this.afDatabase.li...
DatabaseService:处理我们的应用程序需要的任何持久数据的服务。对于我们的应用程序,我们将实现原生移动设备的存储选项,例如应用程序设置,作为一个简单的键/值存储。但是,你也可以在这里实现更高级的存储选项,例如通过 Firebase 进行远程存储。 创建app/modules/core/services/log.service.ts: ...
Developer Advocate, Firebase Unlock Angular's full potential. Build real-world structured apps that scale. Angular Framework (v15) Standalone Components and Architecture State Management and Reactive Services Immutable Data Structures and Patterns
mDatabase = FirebaseDatabase.getInstance().getReference("Bithumb/"+data.getText());DatabaseReference Coin = mDatabase;Coin.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { for(DataSnapshot dataSnapshot :snapshot.getChildren())...
如果使用了类似于firebase的服务,暴露来自 firebase 的正确数据流 沙盒的好处有 将表现层与其它部分解耦 抽离状态管理 能够看清一个模块究竟能访问什么 组件没法为所欲为,更好的封装 把乐观更新逻辑放对了地方,因为组件和服务都不关心这个功能。 在不用重写服务和组件的情况下能够切换到不同的状态管理下面 ...
如果使用了类似于 firebase 的服务,暴露来自 firebase 的正确数据流 沙盒的好处有 将表现层与其它部分解耦 抽离状态管理 能够看清一个模块究竟能访问什么 组件没法为所欲为,更好的封装 把乐观更新逻辑放对了地方,因为组件和服务都不关心这个功能。 在不用重写服务和组件的情况下能够切换到不同的状态管理下面 ...