fix insert function
This commit is contained in:
parent
e4002ce835
commit
a7d6ee9cd3
|
@ -19,8 +19,8 @@ export class DataProviderService {
|
||||||
// }
|
// }
|
||||||
public url = 'http://4255-34-91-36-11.ngrok.io/'
|
public url = 'http://4255-34-91-36-11.ngrok.io/'
|
||||||
insert(dbname: String,colname: String,web: String,cat: String){
|
insert(dbname: String,colname: String,web: String,cat: String){
|
||||||
//return this.http.get<providerData>("http://localhost:/insert?dbname="+dbname+"&collectionname="+colname+"&web="+web+"&cat="+cat);
|
return this.http.get<providerData>(this.url+"/insert?dbname="+dbname+"&collectionname="+colname+"&web="+web+"&cat="+cat);
|
||||||
return this.http.get<providerData>(this.url+"/insert?dbname=data&collectionname=testdata&web=com.burbn.instagram&cat=photos");
|
//return this.http.get<providerData>(this.url+"/insert?dbname=data&collectionname=testdata&web=com.burbn.instagram&cat=test");
|
||||||
}
|
}
|
||||||
|
|
||||||
public filter(cat: String){
|
public filter(cat: String){
|
||||||
|
|
|
@ -5,18 +5,25 @@
|
||||||
</ion-header>
|
</ion-header>
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-card>
|
<ion-card>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label>Web</ion-label>
|
<ion-label>Web</ion-label>
|
||||||
<br/>
|
<br>
|
||||||
<ion-input [(ngModel)]="web"></ion-input>
|
<ion-input [(ngModel)]="web"></ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label>Category</ion-label>
|
<ion-label>Category</ion-label>
|
||||||
<br/>
|
<br>
|
||||||
<ion-input [(ngModel)]="category"></ion-input>
|
<ion-input [(ngModel)]="category"></ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-button expand='full' (click)="submit()">
|
<ion-button expand='full' (click)="submit()">
|
||||||
Submit
|
Submit
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</ion-card>
|
</ion-card>
|
||||||
|
<div *ngIf='data$ | async as ans'>
|
||||||
|
<ion-card>
|
||||||
|
<ion-card-content>
|
||||||
|
{{ans}}
|
||||||
|
</ion-card-content>
|
||||||
|
</ion-card>
|
||||||
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
|
@ -1,4 +1,6 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { providerData } from 'src/models/temp.model';
|
||||||
import { DataProviderService } from '../data-provider.service';
|
import { DataProviderService } from '../data-provider.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-tab2',
|
selector: 'app-tab2',
|
||||||
|
@ -8,7 +10,8 @@ import { DataProviderService } from '../data-provider.service';
|
||||||
export class Tab2Page implements OnInit {
|
export class Tab2Page implements OnInit {
|
||||||
public web: String
|
public web: String
|
||||||
public category: String
|
public category: String
|
||||||
constructor(private DataProviderService: DataProviderService) {}
|
public data$: Observable<providerData>
|
||||||
|
constructor(private tempProvider: DataProviderService) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
|
@ -16,7 +19,7 @@ export class Tab2Page implements OnInit {
|
||||||
submit() {
|
submit() {
|
||||||
var dbname = "data"
|
var dbname = "data"
|
||||||
var colname = "testdata"
|
var colname = "testdata"
|
||||||
this.DataProviderService.insert(dbname,colname,this.web,this.category)
|
this.data$=this.tempProvider.insert(dbname,colname,this.web,this.category)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue