diff --git a/src/app/data-provider.service.ts b/src/app/data-provider.service.ts index 394b059..0adabe6 100644 --- a/src/app/data-provider.service.ts +++ b/src/app/data-provider.service.ts @@ -19,8 +19,8 @@ export class DataProviderService { // } public url = 'http://4255-34-91-36-11.ngrok.io/' insert(dbname: String,colname: String,web: String,cat: String){ - //return this.http.get("http://localhost:/insert?dbname="+dbname+"&collectionname="+colname+"&web="+web+"&cat="+cat); - return this.http.get(this.url+"/insert?dbname=data&collectionname=testdata&web=com.burbn.instagram&cat=photos"); + return this.http.get(this.url+"/insert?dbname="+dbname+"&collectionname="+colname+"&web="+web+"&cat="+cat); + //return this.http.get(this.url+"/insert?dbname=data&collectionname=testdata&web=com.burbn.instagram&cat=test"); } public filter(cat: String){ diff --git a/src/app/tab2/tab2.page.html b/src/app/tab2/tab2.page.html index 1d5a73c..7f382db 100644 --- a/src/app/tab2/tab2.page.html +++ b/src/app/tab2/tab2.page.html @@ -5,18 +5,25 @@ - - Web -
- -
- - Category -
- -
- - Submit - + + Web +
+ +
+ + Category +
+ +
+ + Submit +
+
+ + + {{ans}} + + +
\ No newline at end of file diff --git a/src/app/tab2/tab2.page.ts b/src/app/tab2/tab2.page.ts index c056b32..4534c52 100644 --- a/src/app/tab2/tab2.page.ts +++ b/src/app/tab2/tab2.page.ts @@ -1,4 +1,6 @@ import { Component, OnInit } from '@angular/core'; +import { Observable } from 'rxjs'; +import { providerData } from 'src/models/temp.model'; import { DataProviderService } from '../data-provider.service'; @Component({ selector: 'app-tab2', @@ -8,7 +10,8 @@ import { DataProviderService } from '../data-provider.service'; export class Tab2Page implements OnInit { public web: String public category: String - constructor(private DataProviderService: DataProviderService) {} + public data$: Observable + constructor(private tempProvider: DataProviderService) {} ngOnInit() { @@ -16,7 +19,7 @@ export class Tab2Page implements OnInit { submit() { var dbname = "data" var colname = "testdata" - this.DataProviderService.insert(dbname,colname,this.web,this.category) + this.data$=this.tempProvider.insert(dbname,colname,this.web,this.category) }