- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Ionic 3 和 Angularfire2 的另一个问题我回到你身边!
我更改了我的页面,以使它们在带有插件的 android 上运行,以及最大限度地使用 native 功能所需的所有东西。
但 !当我尝试时,我面临一个奇怪的问题......
我在编码时没有问题,我可以毫无问题地使用“GeoPoint”类型,Visual Studio Code 可以将类型与文件夹('@firebase/firestore-types')绑定(bind),但是当我在 android 上运行我的应用程序时,我得到了大错误告诉我编译器无法将我的文件夹与类型绑定(bind)...
所以......我无能为力,试图将类型更改为其他类型,尝试直接从“firebase.firestore.GeoPoint”调用类型,但似乎没有任何效果,甚至试图删除项目并重新制作它。 ..
没有什么 :(
无论如何,我希望你们能帮助我,这是我得到的错误:
Error: ./src/pages/add-event/add-event.ts
Module not found: Error: Can't resolve '@firebase/firestore-types' in 'C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\src\pages\add-event'
resolve '@firebase/firestore-types' in 'C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\src\pages\add-event'
Parsed request is a module
using description file: C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\package.json (relative path: ./src/pages/add-event)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\package.json (relative path: ./src/pages/add-event)
resolve as module
looking for modules in C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules
using description file: C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\package.json (relative path: ./node_modules)
using description file: C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types\package.json (relative path: .)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types is not a file
.ts
Field 'browser' doesn't contain a valid alias configuration
C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types.json doesn't exist
as directory
existing directory
using path: C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types\index
using description file: C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types\package.json (relative path: ./index)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types\index doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types\index.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types\index.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types\index.json doesn't exist
[C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types]
[C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types.ts]
[C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types.js]
[C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types.json]
[C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types\index]
[C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types\index.ts]
[C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types\index.js]
[C:\Users\Damien\Documents\Ecole\GREP\18032018\Vennel\node_modules\@firebase\firestore-types\index.json]
@ ./src/pages/add-event/add-event.ts 17:0-53
@ ./src/pages/add-event/add-event.module.ts
@ ./src lazy
@ ./node_modules/ionic-angular/util/ng-module-loader.js
@ ./node_modules/ionic-angular/util/module-loader.js
@ ./node_modules/ionic-angular/components/popover/popover-component.js
@ ./node_modules/ionic-angular/index.js
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { AngularFireModule } from 'angularfire2';
import { AngularFirestoreModule } from 'angularfire2/firestore';
import { MyApp } from './app.component';
import { FIREBASE_CONFIG } from './firebase.credentials';
import { GOOGLE_MAPS_APIKEY } from './google.credentials';
import { AgmCoreModule } from '@agm/core';
import { EventService } from '../services/events/event.service';
import { HttpClientModule } from '@angular/common/http';
import { } from '@firebase/firestore-types';
import { ToastService } from '../services/toast/toast.service';
import { NativeGeocoder } from '@ionic-native/native-geocoder';
import { AuthService } from '../services/auth/auth.service';
import { UserService } from '../services/users/user.service';
import { AngularFireAuth } from 'angularfire2/auth';
import { Geolocation } from '@ionic-native/geolocation';
@NgModule({
declarations: [
MyApp
],
imports: [
BrowserModule,
HttpClientModule,
IonicModule.forRoot(MyApp),
AngularFireModule.initializeApp(FIREBASE_CONFIG),
AgmCoreModule.forRoot({
apiKey:GOOGLE_MAPS_APIKEY
}),
AngularFirestoreModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp
],
providers: [
StatusBar,
SplashScreen,
NativeGeocoder,
{provide: ErrorHandler, useClass: IonicErrorHandler},
EventService,
ToastService,
AuthService,
UserService,
AngularFireAuth,
Geolocation
]
})
export class AppModule {}
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {Event} from '../../models/event/event.interface';
import { EventService } from '../../services/events/event.service';
import { GOOGLE_MAPS_APIKEY } from '../../app/google.credentials';
import { HttpClient } from '@angular/common/http';
import { ToastService } from '../../services/toast/toast.service';
import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult } from '@ionic-native/native-geocoder';
import { GeoPoint } from '@firebase/firestore-types';
import * as firebase from 'firebase/app';
@IonicPage()
@Component({
selector: 'page-add-event',
templateUrl: 'add-event.html',
})
export class AddEventPage {
event : Event = {
name : ['',''],
address : undefined,
city : '',
place : '',
date : undefined,
tags : '',
description : '',
isPaying : false
}
constructor(
public navCtrl: NavController,
public navParams: NavParams,
public httpClient: HttpClient,
private eventsServ:EventService,
private toast : ToastService,
private nativeGeocoder : NativeGeocoder,
private testGeo : GeoPoint
){}
getCoordinates(address:string){
this.nativeGeocoder.forwardGeocode(address)
.then((coordinates: NativeGeocoderForwardResult) => console.log('The coordinates are latitude=' + coordinates.latitude + ' and longitude=' + coordinates.longitude))
.catch((error: any) => console.log(error));
}
addEvent(event){
let geopoint : firebase.firestore.GeoPoint;
let address : String = event.address;
let url = "https://maps.googleapis.com/maps/api/geocode/json?address="+address+"&key="+GOOGLE_MAPS_APIKEY;
let response = this.httpClient.get(url);
response.subscribe(data =>{
//var latitude = data.results[0].geometry.location.lat;
//var longitude = data.results[0].geometry.location.lng; //s
var latitude = 46;
var longitude = 6; //s
geopoint = new firebase.firestore.GeoPoint(latitude, longitude);
event.address = geopoint;
this.eventsServ.addEvent(event).then(ref=>{
console.log(ref);
this.toast.show('Événement ajouté avec succès !', 3000);
this.navCtrl.setRoot('HomePage', {key:ref.id});
});
});
}
ionViewDidLoad() {
console.log('ionViewDidLoad AddEventPage');
}
}
{
"name": "Vennel",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@agm/core": "^1.0.0-beta.2",
"@angular/common": "5.0.3",
"@angular/compiler": "5.0.3",
"@angular/compiler-cli": "5.0.3",
"@angular/core": "5.0.3",
"@angular/forms": "5.0.3",
"@angular/http": "5.0.3",
"@angular/platform-browser": "5.0.3",
"@angular/platform-browser-dynamic": "5.0.3",
"@firebase/firestore": "^0.3.5",
"@firebase/firestore-types": "^0.2.2",
"@ionic-native/core": "4.4.0",
"@ionic-native/geolocation": "^4.5.3",
"@ionic-native/native-geocoder": "^4.5.3",
"@ionic-native/splash-screen": "4.4.0",
"@ionic-native/status-bar": "4.4.0",
"@ionic/storage": "2.1.3",
"angularfire2": "^5.0.0-rc.6",
"cordova-android": "7.0.0",
"cordova-plugin-device": "^2.0.1",
"cordova-plugin-geolocation": "^4.0.1",
"cordova-plugin-ionic-keyboard": "^2.0.5",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-whitelist": "^1.3.3",
"firebase": "^4.11.0",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"jquery": "^3.3.1",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.8",
"typescript": "2.4.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": "To locate you"
}
},
"platforms": [
"android"
]
}
}
最佳答案
-types
包只是类型,不能作为运行时值。使用 @firebase/app
取而代之的是模块。
这对我有用:
import * as firebase from 'firebase/app';
deleteMemberId(chatGroupId: string, memberId: string, userIdToken: string): void {
this.afs.doc<any>(`messageGroups/${chatGroupId}`).update({
memberIds: firebase.firestore.FieldValue.arrayRemove(memberId) //here
});
}
关于android - 无法解析 '@firebase/firestore-types',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49352847/
假设a是张量,那么有什么区别: 类型(a) a.类型 a.type() 我找不到区分这些的文档。 最佳答案 type 是 python 内置方法。 它将返回对象的类型。喜欢 torch.Tensor.
什么是 Type 1 的居民的例子?两者都不是 Type也不是Type的居民?在 Idris REPL 中进行探索时,我无法想出任何东西。 更准确地说,我正在寻找一些 x除了 Type产生以下结果:
我找到了一些资源,但我不确定我是否理解。 我找到的一些资源是: http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb2ff3358411d1829f00
这两个函数原型(prototype)有什么区别? void apply1(double(f)(double)); void apply2(double(*f)(double)); 如果目标是将提供的函
http://play.golang.org/p/icQO_bAZNE 我正在练习使用堆进行排序,但是 prog.go:85: type bucket is not an expression
假设有一个泛型定义的方法信息对象,即一个方法信息对象,这样的方法Info.IsGenericMethodDefinition==TRUE:。也可以说它们也有一个泛型参数列表:。我可以使用以下命令获取该
在具有依赖类型的语言中,您可以使用 Type-in-Type 来简化语言并赋予它很多功能。这使得语言在逻辑上不一致,但如果您只对编程感兴趣而不对定理证明感兴趣,这可能不是问题。 在 Cayenne
根据 Nim 手册,变量类型是“静态类型”,而变量在内存中指向的实际值是“动态类型”。 它们怎么可能是不同的类型?我认为将错误的类型分配给变量将是一个错误。 最佳答案 import typetrait
假设您有以下结构和协议(protocol): struct Ticket { var items: [TicketItem] = [] } struct TicketItem { } prot
我正在处理一个 EF 问题,我发现它很难调试...以前,在我的系统中有一个表类型继承设置管理不同的用户类型 - 所有用户共有的一种根类型,以及大致基于使用该帐户的人员类型的几种不同的子类型。现在,我遇
这是我的 DBManager.swift import RealmSwift class DBManager { class func getAllDogs() -> [Dog] {
我正在尝试使用傅里叶校正图像中的曝光。这是我面临的错误 5 padded = np.log(padded + 1) #so we never have log of 0 6 g
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 9 年前。 Improve
请考虑以下设置: protocol MyProcotol { } class MyModel: MyProcotol { } enum Result { case success(value:
好吧,我将我的 python 项目编译成一个可执行文件,它在我的电脑上运行,但我将它发送给几个 friend 进行测试,他们都遇到了这个错误。我以前从未见过这样的错误。我使用 Nuitka 来编译代码
当我尝试训练我的模型时"ValueError: Type must be a sub-type of ndarray type"出现在 line x_norm=(np.power(x,2)).sum(
我尝试在另一个类中打断、计数然后加入对象。所以我构建协议(protocol): typealias DataBreaker = () -> [Double] typealias DataJoiner
我正在使用 VS 2015 更新 3、Angular 2.1.2、Typescript 2.0.6 有人可以澄清什么是 typings 与 npm @types 以及本月很难找到的任何其他文档吗? 或
我正在考虑从 VS2010 更改为 Mono,因此我通过 MoMA 运行我的程序集,看看我在转换过程中可能遇到多少困难。在生成的报告中,我发现我不断收到此错误: bool Type.op_Equali
主要问题 不太确定这是否可能,但由于我讨厌 Typescript 并且它使我的编码变得困难,我想我会问只是为了确定。 interface ISomeInterface { handler: ()
我是一名优秀的程序员,十分优秀!