Remove Angular (#17534)

GitOrigin-RevId: 7a0d45e17d9905fa75569e2d19ca59caa4a41565
This commit is contained in:
Alf Eaton
2024-06-06 08:04:09 +00:00
committed by Copybot
parent b3d33fe813
commit c24ace801b
149 changed files with 665 additions and 21004 deletions
@@ -1,28 +0,0 @@
import { ScopeValueStore } from '../../../../../types/ide/scope-value-store'
import { Scope } from '../../../../../types/angular/scope'
import _ from 'lodash'
export class AngularScopeValueStore implements ScopeValueStore {
// eslint-disable-next-line no-useless-constructor
constructor(readonly $scope: Scope) {}
get(path: string) {
return _.get(this.$scope, path)
}
set(path: string, value: unknown): void {
this.$scope.$applyAsync(() => _.set(this.$scope, path, value))
}
watch<T>(
path: string,
callback: (newValue: T) => void,
deep: boolean
): () => void {
return this.$scope.$watch(
path,
(newValue: T) => callback(deep ? _.cloneDeep(newValue) : newValue),
deep
)
}
}