fix
This commit is contained in:
@@ -1,32 +1,36 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'start',
|
||||
loadChildren: () => import('./start/start.module').then( m => m.StartPageModule)
|
||||
},
|
||||
{
|
||||
path: 'signup',
|
||||
loadChildren: () => import('./signup/signup.module').then( m => m.SignupPageModule)
|
||||
},
|
||||
{
|
||||
path: 'login',
|
||||
loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
|
||||
},
|
||||
{
|
||||
path: 'settings',
|
||||
loadChildren: () => import('./users/settings/settings.module').then( m => m.SettingsPageModule)
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'start',
|
||||
loadChildren: () => import('./start/start.module').then( m => m.StartPageModule)
|
||||
},
|
||||
{
|
||||
path: 'signup',
|
||||
loadChildren: () => import('./signup/signup.module').then( m => m.SignupPageModule)
|
||||
},
|
||||
{
|
||||
path: 'login',
|
||||
loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
|
||||
},
|
||||
{
|
||||
path: 'settings',
|
||||
loadChildren: () => import('./users/settings/settings.module').then( m => m.SettingsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'blogdetail',
|
||||
loadChildren: () => import('./blogdetail/blogdetail.module').then( m => m.BlogdetailPageModule)
|
||||
];
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule {}
|
||||
}
|
||||
|
||||
];
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { RouteReuseStrategy } from '@angular/router';
|
||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||
|
||||
|
||||
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
||||
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
||||
@@ -12,7 +14,7 @@ import { AppComponent } from './app.component';
|
||||
@NgModule({
|
||||
declarations: [AppComponent],
|
||||
entryComponents: [],
|
||||
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
|
||||
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,HttpClientModule],
|
||||
providers: [
|
||||
StatusBar,
|
||||
SplashScreen,
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>CoreGrade</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
@@ -1,9 +1,54 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
//import { resolve } from 'dns';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CoreServiceService {
|
||||
|
||||
constructor() { }
|
||||
url = 'https://www.chiefsoft.net/INTGR/API/coregrade/';
|
||||
apiKey = ''; // <-- Enter your own key here!
|
||||
|
||||
constructor(
|
||||
private http: HttpClient
|
||||
) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
getResult: any;
|
||||
blogData(title: string) {
|
||||
// blogData(title: string): Observable<any> {
|
||||
var end_url = this.url + "?s=" + encodeURI(title) + "&apikey=" + this.apiKey;
|
||||
// return this.http.get(`${this.url}?s=${encodeURI(title)}&apikey=${this.apiKey}`).pipe(
|
||||
|
||||
/* return this.http.get(this.url+"?s="+encodeURI(title)+"&apikey="+this.apiKey).pipe(
|
||||
map(results => results['internal_return'])
|
||||
*/
|
||||
return from(
|
||||
new Promise((resolve) => {
|
||||
|
||||
this.http.get(end_url).subscribe(
|
||||
(data) => {
|
||||
this.getResult = data;
|
||||
// console.log(this.getResult);
|
||||
resolve(data);
|
||||
}
|
||||
)
|
||||
|
||||
})
|
||||
)
|
||||
|
||||
//console.log(results);
|
||||
// );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title><img src="./../assets/imgs/app-logo.png"></ion-title>
|
||||
<ion-title>CoreGrade</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
@@ -20,55 +20,26 @@
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ion-grid>
|
||||
|
||||
<ion-row>
|
||||
<ion-row *ngFor="let type of blog_list" (click)="openBlogItem(type)">
|
||||
<ion-col size="9">
|
||||
<p>CoreGrade is your interest connection platform. Enter the page of the group to get started. You can also find
|
||||
an open group by using the search.
|
||||
<p>{{type.short_desciption}}
|
||||
</p>
|
||||
</ion-col>
|
||||
<ion-col size="3">
|
||||
<img src="./../assets/imgs/app-logo.png">
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
<ion-col size="9">
|
||||
<p>CoreGrade is your interest connection platform. Enter the page of the group to get started. You can also find
|
||||
an open group by using the search.
|
||||
</p>
|
||||
</ion-col>
|
||||
<ion-col size="3">
|
||||
<img src="./../assets/imgs/app-logo.png">
|
||||
<img src="{{image_url}}{{type.meta_value}}" />
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
|
||||
<ion-row>
|
||||
<ion-col size="9">
|
||||
<p>CoreGrade is your interest connection platform. Enter the page of the group to get started. You can also find
|
||||
an open group by using the search.
|
||||
</p>
|
||||
</ion-col>
|
||||
<ion-col size="3">
|
||||
<img src="./../assets/imgs/app-logo.png">
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
|
||||
<ion-row>
|
||||
<ion-col size="9">
|
||||
<p>CoreGrade is your interest connection platform. Enter the page of the group to get started. You can also find
|
||||
an open group by using the search.
|
||||
</p>
|
||||
</ion-col>
|
||||
<ion-col size="3">
|
||||
<img src="./../assets/imgs/app-logo.png">
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
|
||||
</ion-grid>
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { CoreServiceService } from './../services/core-service.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { core } from '@angular/compiler';
|
||||
|
||||
@Component({
|
||||
selector: 'app-start',
|
||||
@@ -8,11 +9,34 @@ import { Component, OnInit } from '@angular/core';
|
||||
styleUrls: ['./start.page.scss'],
|
||||
})
|
||||
export class StartPage implements OnInit {
|
||||
blogData: any;
|
||||
constructor( private router: Router, private coreServiceService:CoreServiceService) { this.getBlog(); }
|
||||
|
||||
constructor( private router: Router) { }
|
||||
|
||||
|
||||
image_url = "https://blog.chiefsoft.com/wp-content/uploads/";
|
||||
ngOnInit() {
|
||||
this.getBlog();
|
||||
}
|
||||
|
||||
blog_list: any;
|
||||
getBlog() {
|
||||
this.coreServiceService.blogData("blackblog").subscribe((retBlogData) => {
|
||||
this.blogData = retBlogData;
|
||||
//console.log(this.blogData);
|
||||
//console.log(this.blogData["internal_return"]["result_list"]);
|
||||
this.image_url = this.blogData["internal_return"]["image_url"];
|
||||
this.blog_list = this.blogData["internal_return"]["result_list"];
|
||||
console.log(this.blog_list);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
openBlogItem(selBlogdata: any) {
|
||||
// alert(selBlogdata.id);
|
||||
this.router.navigateByUrl("blogdetail",selBlogdata);
|
||||
}
|
||||
|
||||
onLogin(){
|
||||
this.router.navigateByUrl('login');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user