This file contains hidden or 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 { dirname, relative } from 'path'; | |
| import * as ts from 'typescript'; | |
| import { | |
| StandardTransform, | |
| TransformOperation, | |
| collectDeepNodes, | |
| insertStarImport, | |
| ReplaceNodeOperation, | |
| makeTransform, | |
| } from "@ngtools/webpack/src/transformers" |
This file contains hidden or 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
| const viewStateKey = "__vs"; | |
| export function attachViewState<T>(attachTo: string, defaultValueFactory?: () => T) { | |
| return (target: any, key: string) => { | |
| const assureViewState = (obj) => { | |
| if (typeof obj[attachTo][viewStateKey] === "undefined") { | |
| // console.log("> creating default view sate"); | |
| obj[attachTo][viewStateKey] = defaultValueFactory(); | |
| } | |
| } |
OlderNewer