This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { EntityMetadataMap } from '@ngrx/data'; | |
/** | |
* Compare function for Entities sort | |
* @param {string} a | |
* @param {string} b | |
* @returns {number} | |
*/ | |
export function sortByTitle( | |
a: { title: string }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PropsFilterFnFactory, EntityMetadataMap } from '@ngrx/data'; | |
/** | |
* Filter for entities whose name matches the case-insensitive pattern | |
* The filter works on ALL properties | |
* @param {T[]} entities | |
* @param {string} pattern | |
* @return {any[]} | |
*/ | |
export function textFilter<T extends { title: string; description: string }>( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { EntitySelectorsFactory } from "@ngrx/data"; | |
import { createSelector } from "@ngrx/store"; | |
import { Todo } from "../dto/todo"; | |
export const todoSelectors = new EntitySelectorsFactory().create<Todo>('Todo'); | |
export const selectTodoByCategory = (category: string) => createSelector( | |
todoSelectors.selectEntities, | |
(data) => data.filter(c => c.category === category) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { EntityMetadataMap } from '@ngrx/data'; | |
export function activeFilter(entities: { active: boolean }[], search: boolean) { | |
return entities.filter(e => e.active === search); | |
} | |
const entityMetadata: EntityMetadataMap = { | |
Todo: { | |
filterFn: activeFilter | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- "10" | |
dist: trusty | |
sudo: required | |
addons: | |
chrome: stable | |
sonarcloud: | |
organization: "aboudard" | |
branches: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgbDatepickerConfig, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap'; | |
import { NgbDateFRParserFormatter } from "./ngb-date-fr-parser-formatter" | |
@Component({ | |
providers: [{provide: NgbDateParserFormatter, useClass: NgbDateFRParserFormatter}] | |
}) | |
export class AppComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p { color: red; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(90deg, #ccc, yellow); | |
min-height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a { color: white; font-weight: bold; | |
padding: 10px; background: red; | |
text-decoration: none; | |
transition-property: background; | |
transition-duration: 1000ms;} | |
a:hover { background: blue; } |