Skip to content

Commit

Permalink
chore(demo): update to Angular 17
Browse files Browse the repository at this point in the history
  • Loading branch information
tinesoft committed Jan 11, 2024
1 parent 0a0c9b0 commit ced8a54
Show file tree
Hide file tree
Showing 10 changed files with 4,454 additions and 5,247 deletions.
6 changes: 3 additions & 3 deletions apps/demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "demo:build:production"
"buildTarget": "demo:build:production"
},
"development": {
"browserTarget": "demo:build:development"
"buildTarget": "demo:build:development"
}
},
"defaultConfiguration": "development",
Expand All @@ -79,7 +79,7 @@
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "demo:build"
"buildTarget": "demo:build"
}
},
"lint": {
Expand Down
27 changes: 21 additions & 6 deletions apps/demo/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { HttpClient, provideHttpClient } from '@angular/common/http';
import { SecurityContext } from '@angular/core';
import { ApplicationConfig } from '@angular/platform-browser';
import { ENVIRONMENT_INITIALIZER, SecurityContext } from '@angular/core';
import { ApplicationConfig } from '@angular/core';

import { NgcCookieConsentConfig, provideNgcCookieConsent } from 'ngx-cookieconsent';

Expand All @@ -10,8 +10,13 @@ import { environment } from '../environments/environment';
import { provideRouter, withEnabledBlockingInitialNavigation } from '@angular/router';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { MarkdownModule, MarkedOptions } from 'ngx-markdown';
import { MARKED_OPTIONS, provideMarkdown } from 'ngx-markdown';
import { appRoutes } from './app.routes';
import { FaIconLibrary } from '@fortawesome/angular-fontawesome';
import { IconDefinition, faBolt, faBook, faCheck, faClipboard, faFileText, faGear, faLanguage, faImage, faInfo, faLink, faMapMarker, faUndo, faVcard } from '@fortawesome/free-solid-svg-icons';
import { faGithub } from '@fortawesome/free-brands-svg-icons';

const iconsList: IconDefinition[] = [faUndo, faMapMarker, faLanguage, faLink, faGear, faFileText, faVcard, faImage, faCheck, faClipboard, faInfo, faBook, faBolt, faGithub];

const cookieConfig: NgcCookieConsentConfig = {
cookie: {
Expand Down Expand Up @@ -46,10 +51,10 @@ export const appConfig: ApplicationConfig = {
}
}).providers,
provideNgcCookieConsent(cookieConfig),
MarkdownModule.forRoot(
provideMarkdown(
{
markedOptions: {
provide: MarkedOptions,
provide: MARKED_OPTIONS,
useValue: {
gfm: true,
breaks: false,
Expand All @@ -60,6 +65,16 @@ export const appConfig: ApplicationConfig = {
},
sanitize: SecurityContext.NONE
}
).providers,
),
{
provide: ENVIRONMENT_INITIALIZER,
useFactory: (iconLibrary: FaIconLibrary) => async() => {
// Add any icons needed here:
iconLibrary.addIcons(...iconsList);
},
// When using a factory provider you need to explicitly specify its dependencies.
deps: [FaIconLibrary],
multi: true,
},
]
}
8 changes: 4 additions & 4 deletions apps/demo/src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ <h1 class="display-3 fw-semibold">ngx-cookieconsent</h1>
<p class="fs-4 fw-normal pt-2"><a href="https://cookieconsent.insites.com/" target="_blank" rel="noopener">Cookie Consent</a> module for Angular.</p>
<p class="fs-4 fw-normal">Scroll down to see it in action!</p>
<p class="p-2">
<a class="btn btn-outline-primary btn-lg me-2" href="https://cookieconsent.insites.com/" target="_blank" rel="noopener"><i class="fa fa-info fa-lg"></i> Learn More</a>
<a class="btn btn-outline-primary btn-lg me-2" href="doc/index.html" target="_blank" rel="noopener"><i class="fa fa-book fa-lg"></i> Documentation</a>
<a class="btn btn-outline-primary btn-lg me-2" href="#" (click)="editOnStackBlitz()"><i class="fa fa-bolt fa-lg"></i> Edit on StackBlitz</a>
<a class="btn btn-outline-primary btn-lg me-2" href="https://github.com/tinesoft/ngx-cookieconsent" target="_blank" rel="noopener" title="Code on Github"><i class="fa fa-github fa-lg"></i> </a>
<a class="btn btn-outline-primary btn-lg me-2" href="https://cookieconsent.insites.com/" target="_blank" rel="noopener"><fa-icon icon="info" size="lg"/> Learn More</a>
<a class="btn btn-outline-primary btn-lg me-2" href="doc/index.html" target="_blank" rel="noopener"><fa-icon icon="book" size="lg"/> Documentation</a>
<a class="btn btn-outline-primary btn-lg me-2" href="#" (click)="editOnStackBlitz()"><fa-icon icon="bolt" size="lg"/> Edit on StackBlitz</a>
<a class="btn btn-outline-primary btn-lg me-2" href="https://github.com/tinesoft/ngx-cookieconsent" target="_blank" rel="noopener" title="Code on Github"><fa-icon [icon]="['fab', 'github']" size="lg"/> </a>
</p>

</div>
Expand Down
3 changes: 2 additions & 1 deletion apps/demo/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import { Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import sdk from '@stackblitz/sdk';
import { PlaygroundComponent } from './playground/playground.component';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';

@Component({
selector: 'ngc-demo-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
standalone: true,
imports: [PlaygroundComponent]
imports: [PlaygroundComponent, FaIconComponent]
})
export class HomeComponent implements OnInit {

Expand Down
Loading

0 comments on commit ced8a54

Please sign in to comment.