Skip to content

Instantly share code, notes, and snippets.

View advorkina's full-sized avatar

Anastasia Dvorkina advorkina

View GitHub Profile
//...
import { NgxsModule } from '@ngxs/store';
@NgModule({
imports: [
//...
NgxsModule.forFeature([HomeState]),
],
})
export class HomeModule {}
//...
import { NgxsModule } from '@ngxs/store';
@NgModule({
declarations: [AppComponent],
imports: [
//...
NgxsModule.forRoot([]),
],
providers: [],
@advorkina
advorkina / home.state.ts
Created January 3, 2019 12:45
ngxs state
import { State } from '@ngxs/store';
@State<HomeState>({
name: 'team',
defaults: {
isOpen: false
}
})
export class HomeState {
public isOpen: boolean;
}
npm install @ngxs/store --save
npm i @ngxs/logger-plugin @ngxs/devtools-plugin --only=dev
{
"scripts": {
"buildProd": "ng build --base-href=/your-project-slug/"
}
{
"projects": {
"architect": {
"build": {
"options": {
"outputPath": "public"
image: node:8.12.0
pages:
cache:
paths:
- node_modules/
script:
- npm install -g @angular/[email protected]
- npm install
- npm run buildProd
artifacts:
beforeEach(
async(() => {
TestBed.configureTestingModule({
providers: [SomeProvider],
declarations: [DropzoneComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
}).compileComponents();
})
);
<span [class.isActive]="isActive()">{{title}}</span>
<folders [folders]="folders"
[activeFolder]="activeFolder"
(folderSelected)="folderSelected($event)">
</folders>
<documents [documents]="documents"
(documentOpened)="documentOpened($event)">
</documents>
beforeEach(
async(() => {
TestBed.configureTestingModule({
providers: [SomeProvider],
declarations: [DropzoneComponent, DocumentsComponent, FoldersComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
}).compileComponents();
})
);