Skip to content

Commit

Permalink
feat: add date on preview
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoblanc committed Jan 7, 2024
1 parent 1265773 commit e3a05d3
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 33 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"start:dev": "ng serve",
"build": "ng build",
"test": "ng test",
"test-debug": "ng test --browsers ChromeDebug",
Expand Down Expand Up @@ -114,4 +115,4 @@
"ios"
]
}
}
}
53 changes: 30 additions & 23 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
import { HttpClientModule } from '@angular/common/http';
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';
import { HTTP } from '@ionic-native/http/ngx';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { IonicStorageModule } from '@ionic/storage-angular';
import * as CordovaSQLiteDriver from 'localforage-cordovasqlitedriver';
import { Drivers } from '@ionic/storage';
import { MetaMediaService } from './provider/meta-media/meta-media.service';
import { initializeAppFactory } from './core/initializer/media.initializer';
import { Media } from '@awesome-cordova-plugins/media/ngx';
import { HttpClientModule } from "@angular/common/http";
import { APP_INITIALIZER, LOCALE_ID, NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { RouteReuseStrategy } from "@angular/router";
import { HTTP } from "@ionic-native/http/ngx";
import { InAppBrowser } from "@ionic-native/in-app-browser/ngx";
import { SplashScreen } from "@ionic-native/splash-screen/ngx";
import { IonicModule, IonicRouteStrategy } from "@ionic/angular";
import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
import { IonicStorageModule } from "@ionic/storage-angular";
import * as CordovaSQLiteDriver from "localforage-cordovasqlitedriver";
import { Drivers } from "@ionic/storage";
import { MetaMediaService } from "./provider/meta-media/meta-media.service";
import { initializeAppFactory } from "./core/initializer/media.initializer";
import { Media } from "@awesome-cordova-plugins/media/ngx";

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule,
imports: [
BrowserModule,
IonicModule.forRoot(),
AppRoutingModule,
HttpClientModule,
IonicStorageModule.forRoot({
driverOrder: [CordovaSQLiteDriver._driver, Drivers.IndexedDB, Drivers.LocalStorage],
})],
driverOrder: [
CordovaSQLiteDriver._driver,
Drivers.IndexedDB,
Drivers.LocalStorage,
],
}),
],
providers: [
SplashScreen,
InAppBrowser,
Expand All @@ -32,11 +38,12 @@ import { Media } from '@awesome-cordova-plugins/media/ngx';
provide: APP_INITIALIZER,
useFactory: initializeAppFactory,
deps: [MetaMediaService],
multi: true
multi: true,
},
Media,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
{ provide: LOCALE_ID, useValue: "fr" },
],
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})
export class AppModule { }
export class AppModule {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div class="article">
<div *ngIf="mixedContent?.image?.url" class="img-container" [style.background-image]="'url('+mixedContent.image.url+')'" ></div>
<div class="title" [innerHTML]="mixedContent.title" >
<div *ngIf="mixedContent?.image?.url" class="img-container"
[style.background-image]="'url('+mixedContent.image.url+')'"></div>
<div class="title" [innerHTML]="mixedContent.title">
</div>

<ion-chip>
Expand All @@ -9,4 +10,7 @@
</ion-avatar>
<ion-label>{{mixedContent.metaMedia.title}}</ion-label>
</ion-chip>
</div>
<ion-chip>
<ion-label>{{mixedContent.publishedAt | date}}</ion-label>
</ion-chip>
</div>
18 changes: 12 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from "@angular/core";
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { AppModule } from "./app/app.module";
import { environment } from "./environments/environment";

import localeFr from "@angular/common/locales/fr";
import { registerLocaleData } from "@angular/common";

registerLocaleData(localeFr, "fr");

if (environment.production) {
enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch((err) => console.log(err));

0 comments on commit e3a05d3

Please sign in to comment.