Skip to content

Commit b8d0b87

Browse files
committed
Tests for getScopeByName
1 parent 58e110d commit b8d0b87

File tree

23 files changed

+82
-36
lines changed

23 files changed

+82
-36
lines changed

@types/angular.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export class Angular {
129129
modules?: Array<string | any>,
130130
config?: import("./interface.ts").AngularBootstrapConfig,
131131
): import("./core/di/internal-injector.js").InjectorService;
132+
$rootScope: import("./interface.ts").Scope;
132133
$injector: import("./interface.ts").InjectorService;
133134
/**
134135
* @param {any[]} modules
@@ -143,6 +144,17 @@ export class Angular {
143144
* @param {Element|Document} element
144145
*/
145146
init(element: Element | Document): void;
147+
/**
148+
* Retrieves a scope by its registered name and returns its Proxy wrapper.
149+
*
150+
* Internally, this walks down the `Scope` tree starting from `$rootScope`
151+
* and checks for a matching `$scopename` property. The `$scopename` property
152+
* may be defined statically or assigned via the `ngScope` directive.
153+
*
154+
* @param {string} name
155+
* @returns {ProxyHandler<ng.Scope>|undefined}
156+
*/
157+
getScopeByName(name: string): ProxyHandler<ng.Scope> | undefined;
146158
}
147159
import { errorHandlingConfig } from "./shared/utils.js";
148160
import { NgModule } from "./core/di/ng-module/ng-module.js";

@types/core/controller/controller.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class ControllerProvider {
3434
$get: (
3535
| string
3636
| ((
37-
$injector: import("../../core/di/internal-injector.js").InjectorService,
37+
$injector: ng.InjectorService,
3838
) => import("./interface.ts").ControllerService)
3939
)[];
4040
/**

@types/core/scope/scope.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function createScope(target?: any, context?: Scope): Scope;
1515
*/
1616
export function isUnsafeGlobal(target: any): boolean;
1717
export const $postUpdateQueue: any[];
18+
export let rootScope: any;
1819
export class RootScopeProvider {
1920
rootScope: Scope;
2021
$get: (
@@ -89,6 +90,7 @@ export class Scope {
8990
/** @type {boolean} */
9091
$$destroyed: boolean;
9192
scheduled: any[];
93+
$scopename: any;
9294
/** @private */
9395
private propertyMap;
9496
/**
@@ -181,5 +183,6 @@ export class Scope {
181183
* @returns {Scope|undefined}
182184
*/
183185
$getById(id: string | number): Scope | undefined;
186+
$searchByName(name: any): any;
184187
#private;
185188
}

@types/directive/scope/scope.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* @return {ng.Directive}
3+
*/
4+
export function ngScopeDirective(): ng.Directive;

@types/services/sse/sse.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class SseProvider {
1717
* @type {ng.SseConfig}
1818
*/
1919
defaults: ng.SseConfig;
20-
$get: any[];
20+
$get: (string | ((log: ng.LogService) => ng.SseService))[];
2121
$log: import("../log/interface.ts").LogService;
2222
#private;
2323
}

@types/shared/strings.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,4 @@ export function splitOnDelim(delim: any): (str: any) => any;
4949
* ```
5050
*/
5151
export function joinNeighborsR(acc: any, x: any): any;
52-
export function beforeAfterSubstr(char: any): (str: any) => any[];
53-
export const hostRegex: RegExp;
5452
export function stripLastPathElement(str: any): any;
55-
export function splitHash(str: any): any[];
56-
export function splitQuery(str: any): any[];
57-
export function splitEqual(str: any): any[];
58-
export function trimHashVal(str: any): any;

docs/static/typedoc/assets/hierarchy.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/typedoc/assets/navigation.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/typedoc/assets/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/typedoc/classes/Angular.html

Lines changed: 10 additions & 4 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)