fix
This commit is contained in:
@@ -1,32 +1,36 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
|
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'start',
|
path: 'start',
|
||||||
loadChildren: () => import('./start/start.module').then( m => m.StartPageModule)
|
loadChildren: () => import('./start/start.module').then( m => m.StartPageModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'signup',
|
path: 'signup',
|
||||||
loadChildren: () => import('./signup/signup.module').then( m => m.SignupPageModule)
|
loadChildren: () => import('./signup/signup.module').then( m => m.SignupPageModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'login',
|
path: 'login',
|
||||||
loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
|
loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'settings',
|
path: 'settings',
|
||||||
loadChildren: () => import('./users/settings/settings.module').then( m => m.SettingsPageModule)
|
loadChildren: () => import('./users/settings/settings.module').then( m => m.SettingsPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'blogdetail',
|
||||||
loadChildren: () => import('./blogdetail/blogdetail.module').then( m => m.BlogdetailPageModule)
|
loadChildren: () => import('./blogdetail/blogdetail.module').then( m => m.BlogdetailPageModule)
|
||||||
];
|
}
|
||||||
@NgModule({
|
|
||||||
imports: [
|
];
|
||||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
@NgModule({
|
||||||
],
|
imports: [
|
||||||
exports: [RouterModule]
|
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||||
})
|
],
|
||||||
export class AppRoutingModule {}
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
import { RouteReuseStrategy } from '@angular/router';
|
import { RouteReuseStrategy } from '@angular/router';
|
||||||
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||||
|
|
||||||
|
|
||||||
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
||||||
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
||||||
@@ -12,7 +14,7 @@ import { AppComponent } from './app.component';
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [AppComponent],
|
declarations: [AppComponent],
|
||||||
entryComponents: [],
|
entryComponents: [],
|
||||||
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
|
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,HttpClientModule],
|
||||||
providers: [
|
providers: [
|
||||||
StatusBar,
|
StatusBar,
|
||||||
SplashScreen,
|
SplashScreen,
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<ion-header>
|
<ion-header>
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="start">
|
||||||
|
<ion-back-button></ion-back-button>
|
||||||
|
</ion-buttons>
|
||||||
<ion-title>CoreGrade</ion-title>
|
<ion-title>CoreGrade</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|||||||
@@ -1,9 +1,54 @@
|
|||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
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({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class CoreServiceService {
|
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-header>
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title><img src="./../assets/imgs/app-logo.png"></ion-title>
|
<ion-title>CoreGrade</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
@@ -20,55 +20,26 @@
|
|||||||
</ion-card-content>
|
</ion-card-content>
|
||||||
</ion-card>
|
</ion-card>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ion-grid>
|
<ion-grid>
|
||||||
|
|
||||||
<ion-row>
|
<ion-row *ngFor="let type of blog_list" (click)="openBlogItem(type)">
|
||||||
<ion-col size="9">
|
<ion-col size="9">
|
||||||
<p>CoreGrade is your interest connection platform. Enter the page of the group to get started. You can also find
|
<p>{{type.short_desciption}}
|
||||||
an open group by using the search.
|
|
||||||
</p>
|
</p>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col size="3">
|
<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-col>
|
||||||
</ion-row>
|
</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>
|
</ion-grid>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
import { CoreServiceService } from './../services/core-service.service';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { core } from '@angular/compiler';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-start',
|
selector: 'app-start',
|
||||||
@@ -8,11 +9,34 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
styleUrls: ['./start.page.scss'],
|
styleUrls: ['./start.page.scss'],
|
||||||
})
|
})
|
||||||
export class StartPage implements OnInit {
|
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() {
|
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(){
|
onLogin(){
|
||||||
this.router.navigateByUrl('login');
|
this.router.navigateByUrl('login');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user