Skip to content

Commit 4753d6d

Browse files
committed
refactor(showcase): add introduction module
1 parent 612e1f2 commit 4753d6d

File tree

6 files changed

+123
-0
lines changed

6 files changed

+123
-0
lines changed

projects/ng-sortgrid-demo/src/app/introduction/introduction.component.css

Whitespace-only changes.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<ngsg-demo-nav></ngsg-demo-nav>
2+
<ngsg-demo-header></ngsg-demo-header>
3+
4+
<div class="container">
5+
<h1>1. Getting started</h1>
6+
<ngsg-demo-step title="Loop over your elements with *ngFor. 🛎️ the items needs to be an array. Alternate you can also use the async pipe - see below" image="gs1.png"></ngsg-demo-step>
7+
<ngsg-demo-step title="Apply the ngSortgridItem directive" image="gs2.png"></ngsg-demo-step>
8+
<ngsg-demo-memory></ngsg-demo-memory>
9+
10+
<hr class="chaptor-separator"/>
11+
12+
<h1>2. React on changes</h1>
13+
<p>In most cases you are interested in the new sort order. Often you want to store them in local storage or even send them
14+
to the backend. To do so the following two steps are needed in addition to the "Getting started" step.</p>
15+
<ngsg-demo-step title="Pass your items to the directive via the ngSortGridItems input." image="gs3.png"></ngsg-demo-step>
16+
<ngsg-demo-step title="React on the 'sorted' output events" image="gs4.png"></ngsg-demo-step>
17+
<ngsg-demo-react-on-changes-memory></ngsg-demo-react-on-changes-memory>
18+
19+
<hr class="chaptor-separator"/>
20+
<h1>3. Group sortgrids</h1>
21+
<p>In case you have more than one sortgriditem on the page you need to group the sortgriditems to avoid dropping drags from
22+
one group in another group.</p>
23+
<ngsg-demo-step title="Pass in a unique name to the ngSortGridGroup input" image="gs5.png"></ngsg-demo-step>
24+
<ngsg-demo-groups-memory></ngsg-demo-groups-memory>
25+
26+
<hr class="chaptor-separator"/>
27+
<h1>4. Use the async pipe</h1>
28+
<ngsg-demo-step title="Use the async pipe to loop over the items and to pass in the ngSortGridItems" image="gs6.png"></ngsg-demo-step>
29+
<ngsg-demo-async></ngsg-demo-async>
30+
31+
<hr class="chaptor-separator"/>
32+
<h1>5. Scrolling</h1>
33+
<p>
34+
The scrolling demo is in a separate page because we need more items and a sticky navheader.
35+
</p>
36+
37+
<button class="btn btn-primary" style="margin-bottom: 50px">Check out the demo...</button>
38+
39+
</div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { IntroductionComponent } from './introduction.component';
4+
5+
describe('IntroductionComponent', () => {
6+
let component: IntroductionComponent;
7+
let fixture: ComponentFixture<IntroductionComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ IntroductionComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(IntroductionComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-introduction',
5+
templateUrl: './introduction.component.html',
6+
styleUrls: ['./introduction.component.css']
7+
})
8+
export class IntroductionComponent implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit() {
13+
}
14+
15+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import {NgModule} from '@angular/core';
2+
import {CommonModule} from '@angular/common';
3+
import {IntroductionComponent} from './introduction.component';
4+
import {NavComponent} from '../shared/nav/nav.component';
5+
import {HeaderComponent} from '../shared/header/header.component';
6+
import {GettingStartedMemoryComponent} from './examples/getting-started/getting-started-memory.component';
7+
import {StepComponent} from '../shared/step/step.component';
8+
import {ReactOnChangesMemoryComponent} from './examples/react-on-changes/react-on-changes-memory.component';
9+
import {GroupsMemoryComponent} from './examples/groups/groups-memory.component';
10+
import {CardComponent} from './examples/card/card.component';
11+
import {AsyncPipeMemoryComponent} from './examples/async-pipe/async-pipe-memory.component';
12+
import {IntroductionRoutingModule} from './introduction.routing.module';
13+
import {NgsgModule} from '../../../../ng-sortgrid/src/lib/ngsg.module';
14+
15+
@NgModule({
16+
declarations: [
17+
IntroductionComponent,
18+
NavComponent,
19+
HeaderComponent,
20+
GettingStartedMemoryComponent,
21+
StepComponent,
22+
ReactOnChangesMemoryComponent,
23+
GroupsMemoryComponent,
24+
CardComponent,
25+
AsyncPipeMemoryComponent
26+
],
27+
imports: [
28+
CommonModule,
29+
IntroductionRoutingModule,
30+
NgsgModule
31+
]
32+
})
33+
export class IntroductionModule {
34+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
4+
@NgModule({
5+
declarations: [],
6+
imports: [
7+
CommonModule
8+
]
9+
})
10+
export class SharedModule { }

0 commit comments

Comments
 (0)