Skip to content

Commit 03c23d5

Browse files
Updated source files
1 parent 3afa45b commit 03c23d5

9 files changed

+112
-0
lines changed

src/app/app.component.css

Whitespace-only changes.

src/app/app.component.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="container">
2+
<ejs-listbox [dataSource]='data' [fields]="setfield" [selectionSettings]="selection"></ejs-listbox>
3+
</div>

src/app/app.component.spec.ts

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { TestBed } from '@angular/core/testing';
2+
import { AppComponent } from './app.component';
3+
4+
describe('AppComponent', () => {
5+
beforeEach(async () => {
6+
await TestBed.configureTestingModule({
7+
imports: [AppComponent],
8+
}).compileComponents();
9+
});
10+
11+
it('should create the app', () => {
12+
const fixture = TestBed.createComponent(AppComponent);
13+
const app = fixture.componentInstance;
14+
expect(app).toBeTruthy();
15+
});
16+
17+
it(`should have the 'angular-listbox-getting-started' title`, () => {
18+
const fixture = TestBed.createComponent(AppComponent);
19+
const app = fixture.componentInstance;
20+
expect(app.title).toEqual('angular-listbox-getting-started');
21+
});
22+
23+
it('should render title', () => {
24+
const fixture = TestBed.createComponent(AppComponent);
25+
fixture.detectChanges();
26+
const compiled = fixture.nativeElement as HTMLElement;
27+
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, angular-listbox-getting-started');
28+
});
29+
});

src/app/app.component.ts

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { Component } from '@angular/core';
2+
import { RouterOutlet } from '@angular/router';
3+
import { ListBoxComponent, ListBoxModule, CheckBoxSelection } from '@syncfusion/ej2-angular-dropdowns';
4+
import { ButtonComponent } from '@syncfusion/ej2-angular-buttons'
5+
6+
ListBoxComponent.Inject(CheckBoxSelection);
7+
8+
@Component({
9+
selector: 'app-root',
10+
standalone: true,
11+
imports: [RouterOutlet, ListBoxModule ],
12+
templateUrl: './app.component.html',
13+
styleUrl: './app.component.css'
14+
})
15+
export class AppComponent {
16+
public data: { [key: string]: Object }[] = [
17+
{ id: 'game1', sports: 'Badminton' },
18+
{ id: 'game2', sports: 'Cricket'},
19+
{ id: 'game3', sports: 'Football'},
20+
{ id: 'game4', sports: 'Golf'},
21+
{ id: 'game5', sports: 'Tennis'},
22+
{ id: 'game6', sports: 'Basket Ball'},
23+
{ id: 'game7', sports: 'Base Ball'},
24+
{ id: 'game8', sports: 'Hockey'},
25+
{ id: 'game9', sports: 'Volley Ball'}
26+
];
27+
28+
public fieldSettings = {
29+
text: "sports",
30+
value: "id"
31+
}
32+
33+
public selection = { mode: "Single", showCheckbox: false }
34+
}

src/app/app.config.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
2+
import { provideRouter } from '@angular/router';
3+
4+
import { routes } from './app.routes';
5+
6+
export const appConfig: ApplicationConfig = {
7+
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)]
8+
};

src/app/app.routes.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Routes } from '@angular/router';
2+
3+
export const routes: Routes = [];

src/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>AngularListboxGettingStarted</title>
6+
<base href="/">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<link rel="icon" type="image/x-icon" href="favicon.ico">
9+
</head>
10+
<body>
11+
<app-root></app-root>
12+
</body>
13+
</html>

src/main.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { bootstrapApplication } from '@angular/platform-browser';
2+
import { appConfig } from './app/app.config';
3+
import { AppComponent } from './app/app.component';
4+
5+
6+
7+
import { registerLicense } from '@syncfusion/ej2-base';
8+
9+
registerLicense('ORg4AjUWIQA/Gnt2U1hhQlJBfVddXHxLflFyVWtTfl16d1FWESFaRnZdRl1kSXtTfkdjW3dZdndV')
10+
11+
bootstrapApplication(AppComponent, appConfig)
12+
.catch((err) => console.error(err));

src/styles.css

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* You can add global styles to this file, and also import other style files */
2+
@import '../node_modules/@syncfusion/ej2-dropdowns/styles/material.css';
3+
@import '../node_modules/@syncfusion/ej2-base/styles/material.css';
4+
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
5+
6+
.container{
7+
margin-left: 550px;
8+
margin-top: 100px;
9+
width: 300px;
10+
}

0 commit comments

Comments
 (0)