diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 7352f9c..30221f4 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -11,10 +11,10 @@ export const routes: Routes = [ // { path: 'utilities', loadChildren: () => import('./demo/components/utilities/utilities.module').then(m => m.UtilitiesModule) }, // { path: 'documentation', loadChildren: () => import('./demo/components/documentation/documentation.module').then(m => m.DocumentationModule) }, // { path: 'blocks', loadChildren: () => import('./demo/components/primeblocks/primeblocks.module').then(m => m.PrimeBlocksModule) }, - // { path: 'pages', loadChildren: () => import('./demo/components/pages/pages.module').then(m => m.PagesModule) } + { path: 'pages', loadChildren: () => import('../views/pages/pages.routes')}, ] }, - { path: 'auth', loadChildren: () => import('../views/pages/auth/routes')}, + { path: 'auth', loadChildren: () => import('../views/pages/auth/auth.routes')}, { path: '**', redirectTo: '/notfound' }, ]; diff --git a/src/views/pages/auth/access.ts b/src/views/pages/auth/access.ts index ba32339..4c7fa55 100644 --- a/src/views/pages/auth/access.ts +++ b/src/views/pages/auth/access.ts @@ -4,7 +4,6 @@ import {RouterModule} from '@angular/router'; import {RippleModule} from 'primeng/ripple'; @Component({ - selector: 'app-access', standalone: true, imports: [ ButtonModule, diff --git a/src/views/pages/auth/routes.ts b/src/views/pages/auth/auth.routes.ts similarity index 100% rename from src/views/pages/auth/routes.ts rename to src/views/pages/auth/auth.routes.ts diff --git a/src/views/pages/auth/error.ts b/src/views/pages/auth/error.ts index a5d203c..db5b40e 100644 --- a/src/views/pages/auth/error.ts +++ b/src/views/pages/auth/error.ts @@ -4,7 +4,6 @@ import {RippleModule} from 'primeng/ripple'; import {RouterModule} from '@angular/router'; @Component({ - selector: 'app-error', imports: [ButtonModule, RippleModule, RouterModule], standalone: true, template: ` diff --git a/src/views/pages/auth/login.ts b/src/views/pages/auth/login.ts index 98ae791..7481093 100644 --- a/src/views/pages/auth/login.ts +++ b/src/views/pages/auth/login.ts @@ -10,7 +10,6 @@ import {LayoutService} from '../../../app/layout/service/app.layout.service'; @Component({ - selector: 'app-login', standalone: true, imports: [ ButtonModule, diff --git a/src/views/pages/crud.ts b/src/views/pages/crud.ts new file mode 100644 index 0000000..06f0aa7 --- /dev/null +++ b/src/views/pages/crud.ts @@ -0,0 +1,376 @@ +import {Component, inject, OnInit} from '@angular/core'; +import { MessageService } from 'primeng/api'; +import {Table, TableModule} from 'primeng/table'; +import {CommonModule} from '@angular/common'; +import {FileUploadModule} from 'primeng/fileupload'; +import {FormsModule} from '@angular/forms'; +import {ButtonModule} from 'primeng/button'; +import {RippleModule} from 'primeng/ripple'; +import {ToastModule} from 'primeng/toast'; +import {ToolbarModule} from 'primeng/toolbar'; +import {RatingModule} from 'primeng/rating'; +import {InputTextModule} from 'primeng/inputtext'; +import {TextareaModule} from 'primeng/textarea'; +import {SelectModule} from 'primeng/select'; +import {RadioButtonModule} from 'primeng/radiobutton'; +import {InputNumberModule} from 'primeng/inputnumber'; +import {DialogModule} from 'primeng/dialog'; +import {Product} from '../../app/demo/api/product'; +import {ProductService} from '../../app/demo/service/product.service'; + +@Component({ + standalone: true, + imports: [ + CommonModule, + TableModule, + FileUploadModule, + FormsModule, + ButtonModule, + RippleModule, + ToastModule, + ToolbarModule, + RatingModule, + InputTextModule, + TextareaModule, + SelectModule, + RadioButtonModule, + InputNumberModule, + DialogModule + ], + template: `
Sakai is an application template for Angular and is distributed as a CLI project. Current versions is Angular + v19 with PrimeNG v19. In case CLI is not installed already, use the command below to set it up.
+ +npm install -g @angular/cli
+
+ Once CLI is ready in your system, extract the contents of the zip file distribution, cd to the directory, + install the libraries from npm and then execute "ng serve" to run the application in your local + environment.
+ +cd sakai
+npm install
+ng serve
+
+ The application should run at http://localhost:4200/, you may now start + with the development of your application.
+ +Following commands are derived from CLI.
+ +Run 'ng serve' for a dev server. Navigate to \`http://localhost:4200/\`. The app will automatically reload if you change any of the source files.
+
+Run 'ng generate component component-name' to generate a new component. You can also use \`ng generate directive/pipe/service/class/module\`.
+
+Run 'ng build' to build the project. The build artifacts will be stored in the \`dist/\` directory. Use the \`-prod\` flag for a production build.
+
+Run 'ng test' to execute the unit tests via [Karma](https://karma-runner.github.io).
+
+Run 'ng e2e' to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
+
+Run 'ng help' for more options.
+
+ Sakai consists of 3 main parts; the application layout, layout assets and PrimeNG component theme assets. + Layout is placed inside the src/app/layout folder, + and the assets are in the src/assets/layout folder. +
+ +Initial layout configuration can be defined at the main app component by injecting the LayoutService, this step is optional and only necessary when + customizing the defaults. Note that theme and + scale are not reactive since theme is configured outside of + Angular at index.html by default and + initial scale is defined with the $scale at layout.scss. When default theme or scale is changed at their files initially, + it is required to configure the layout service with the matching values + to avoid sync issues.
+ +import { Component, OnInit } from '@angular/core';
+import { PrimeNGConfig } from 'primeng/api';
+import { LayoutService, AppConfig } from './layout/service/app.layout.service';
+
+@Component({
+ selector: 'app-root',
+ templateUrl: './app.component.html'
+})
+export class AppComponent implements OnInit {
+
+ constructor(private primengConfig: PrimeNGConfig, private layoutService: LayoutService) { }
+
+ ngOnInit(): void {
+ this.primengConfig.ripple = true; //enables core ripple functionality
+
+ //optional configuration with the default configuration
+ const config: AppConfig = {
+ ripple: false, //toggles ripple on and off
+ inputStyle: 'outlined', //default style for input elements
+ menuMode: 'static', //layout mode of the menu, valid values are "static" and "overlay"
+ colorScheme: 'light', //color scheme of the template, valid values are "light" and "dark"
+ theme: 'lara-light-indigo', //default component theme for PrimeNG
+ scale: 14 //size of the body font size to scale the whole application
+ };
+ this.layoutService.config.set(config);
+ }
+
+}
+
+ Menu is a separate component defined in src/app/layout/app.menu.component.ts + file and based on PrimeNG MenuModel API. In order to define the menuitems, + navigate to this file and define your own model as a nested structure.
+ +import { OnInit } from '@angular/core';
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'app-menu',
+ templateUrl: './app.menu.component.html'
+})
+export class AppMenuComponent implements OnInit {
+
+ model: any[] = [];
+
+ ngOnInit() {
+ this.model = [
+ {
+ label: 'Home',
+ items: [
+ {
+ label: 'Dashboard',
+ icon: 'pi pi-fw pi-home',
+ routerLink: ['/']
+ }
+ ]
+ },
+ //...
+ ];
+ }
+}
+
+ Sakai structure is designed in a modular way so that it can easily be integrated with your existing + application. We've created a short tutorial with details.
+ +Sakai provides 34 PrimeNG themes out of the box. Setup of a theme is simple by including the css of theme + to your bundle that are located inside assets/layout/styles/theme/ + folder such as assets/layout/styles/theme/lara-light-indigo/theme.css.
+ +Another alternative would be creating dynamic bundles, please see the video + tutorial for an example.
+This is your empty page template to start building beautiful applications.
+Sed blandit libero volutpat sed cras. Fames ac turpis egestas integer. Placerat in egestas erat...
+ +
+ “Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”
+