Skip to content

Commit 93b256f

Browse files
committed
Version bump 0.28.0
1 parent 3a41fc7 commit 93b256f

14 files changed

Lines changed: 67 additions & 57 deletions

File tree

dist/angular-runtime.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class AngularRuntime extends EventTarget {
6666
this.$t[token] = token;
6767
});
6868
}
69-
if (runtimeOptions.attachToWindow) {
69+
if (!runtimeOptions.subapp) {
7070
window.angular = this;
7171
}
7272
if (runtimeOptions.registerBuiltins) {
@@ -412,14 +412,12 @@ function normalizeRuntimeOptions(options) {
412412
if (typeof options === "boolean") {
413413
return {
414414
subapp: options,
415-
attachToWindow: !options,
416415
registerBuiltins: true,
417416
};
418417
}
419418
const subapp = options.subapp ?? false;
420419
return {
421420
subapp,
422-
attachToWindow: options.attachToWindow ?? !subapp,
423421
registerBuiltins: options.registerBuiltins ?? true,
424422
};
425423
}

dist/angular-ts.esm.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Version: 0.27.0 - May 23, 2026 17:00:12 */
1+
/* Version: 0.28.0 - May 23, 2026 23:51:48 */
22
/**
33
* Canonical token names for the built-in injectables exposed by the core `ng`
44
* module.
@@ -2987,7 +2987,7 @@ class AngularRuntime extends EventTarget {
29872987
/** @internal */
29882988
this._bootsrappedModules = [];
29892989
/** AngularTS version string replaced at build time. */
2990-
this.version = "0.27.0";
2990+
this.version = "0.28.0";
29912991
/** Retrieve the controller instance cached on a compiled DOM element. */
29922992
this.getController = getController;
29932993
/** Retrieve the injector cached on a bootstrapped DOM element. */
@@ -3011,7 +3011,7 @@ class AngularRuntime extends EventTarget {
30113011
this.$t[token] = token;
30123012
});
30133013
}
3014-
if (runtimeOptions.attachToWindow) {
3014+
if (!runtimeOptions.subapp) {
30153015
window.angular = this;
30163016
}
30173017
if (runtimeOptions.registerBuiltins) {
@@ -3357,14 +3357,12 @@ function normalizeRuntimeOptions(options) {
33573357
if (typeof options === "boolean") {
33583358
return {
33593359
subapp: options,
3360-
attachToWindow: !options,
33613360
registerBuiltins: true,
33623361
};
33633362
}
33643363
const subapp = options.subapp ?? false;
33653364
return {
33663365
subapp,
3367-
attachToWindow: options.attachToWindow ?? !subapp,
33683366
registerBuiltins: options.registerBuiltins ?? true,
33693367
};
33703368
}
@@ -6843,6 +6841,7 @@ const ngEventDirectives = EVENT_NAMES.reduce((directives, eventName) => {
68436841
createEventDirectiveFactory(eventName);
68446842
return directives;
68456843
}, {});
6844+
ngEventDirectives.ngClick;
68466845
/**
68476846
* Creates a directive that evaluates an expression when the element event fires.
68486847
*/
@@ -32473,6 +32472,11 @@ class WebSocketProvider {
3247332472
const WASM_SCOPE_IMPORT_NAMESPACE = "angular_ts";
3247432473
const textEncoder = new TextEncoder();
3247532474
const textDecoder = new TextDecoder();
32475+
const UNSAFE_SCOPE_PATH_KEYS = new Set([
32476+
"__proto__",
32477+
"constructor",
32478+
"prototype",
32479+
]);
3247632480
/**
3247732481
* Host-side wrapper around one AngularTS scope exposed to Wasm clients.
3247832482
*
@@ -32927,6 +32931,9 @@ function readScopePath(scope, path) {
3292732931
return scope;
3292832932
}
3292932933
const keys = scopePathKeys(path);
32934+
if (!isSafeScopePath(keys)) {
32935+
return undefined;
32936+
}
3293032937
let current = scope;
3293132938
for (let i = 0, l = keys.length; i < l; i++) {
3293232939
if (current === null || current === undefined) {
@@ -32938,7 +32945,7 @@ function readScopePath(scope, path) {
3293832945
}
3293932946
function writeScopePath(scope, path, value) {
3294032947
const keys = scopePathKeys(path);
32941-
if (keys.length === 0) {
32948+
if (keys.length === 0 || !isSafeScopePath(keys)) {
3294232949
return false;
3294332950
}
3294432951
let current = scope;
@@ -32958,7 +32965,7 @@ function writeScopePath(scope, path, value) {
3295832965
}
3295932966
function deleteScopePath(scope, path) {
3296032967
const keys = scopePathKeys(path);
32961-
if (keys.length === 0) {
32968+
if (keys.length === 0 || !isSafeScopePath(keys)) {
3296232969
return false;
3296332970
}
3296432971
let current = scope;
@@ -32974,6 +32981,9 @@ function deleteScopePath(scope, path) {
3297432981
function scopePathKeys(path) {
3297532982
return path.split(".").filter(Boolean);
3297632983
}
32984+
function isSafeScopePath(keys) {
32985+
return keys.every((key) => !UNSAFE_SCOPE_PATH_KEYS.has(key));
32986+
}
3297732987

3297832988
/**
3297932989
* Runtime identity and DOM globals.
@@ -33321,17 +33331,16 @@ function normalizeServiceRegistrations(services) {
3332133331
}
3332233332

3332333333
/**
33324-
* Creates a side-effect-free AngularTS runtime with no built-in modules.
33334+
* Creates an AngularTS runtime with no built-in modules.
3332533335
*/
3332633336
function createAngularBare(options = {}) {
3332733337
return new AngularRuntime({
33328-
attachToWindow: false,
3332933338
registerBuiltins: false,
3333033339
...options,
3333133340
});
3333233341
}
3333333342
/**
33334-
* Creates a side-effect-free AngularTS runtime with a custom `ng` module.
33343+
* Creates an AngularTS runtime with a custom `ng` module.
3333533344
*/
3333633345
function createAngularCustom(options = {}) {
3333733346
const angular = createAngularBare(options);

dist/angular-ts.umd.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Version: 0.27.0 - May 23, 2026 17:00:09 */
1+
/* Version: 0.28.0 - May 23, 2026 23:51:44 */
22
(function (global, factory) {
33
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
44
typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -2993,7 +2993,7 @@
29932993
/** @internal */
29942994
this._bootsrappedModules = [];
29952995
/** AngularTS version string replaced at build time. */
2996-
this.version = "0.27.0";
2996+
this.version = "0.28.0";
29972997
/** Retrieve the controller instance cached on a compiled DOM element. */
29982998
this.getController = getController;
29992999
/** Retrieve the injector cached on a bootstrapped DOM element. */
@@ -3017,7 +3017,7 @@
30173017
this.$t[token] = token;
30183018
});
30193019
}
3020-
if (runtimeOptions.attachToWindow) {
3020+
if (!runtimeOptions.subapp) {
30213021
window.angular = this;
30223022
}
30233023
if (runtimeOptions.registerBuiltins) {
@@ -3363,14 +3363,12 @@
33633363
if (typeof options === "boolean") {
33643364
return {
33653365
subapp: options,
3366-
attachToWindow: !options,
33673366
registerBuiltins: true,
33683367
};
33693368
}
33703369
const subapp = options.subapp ?? false;
33713370
return {
33723371
subapp,
3373-
attachToWindow: options.attachToWindow ?? !subapp,
33743372
registerBuiltins: options.registerBuiltins ?? true,
33753373
};
33763374
}
@@ -6849,6 +6847,7 @@
68496847
createEventDirectiveFactory(eventName);
68506848
return directives;
68516849
}, {});
6850+
ngEventDirectives.ngClick;
68526851
/**
68536852
* Creates a directive that evaluates an expression when the element event fires.
68546853
*/
@@ -32479,6 +32478,11 @@
3247932478
const WASM_SCOPE_IMPORT_NAMESPACE = "angular_ts";
3248032479
const textEncoder = new TextEncoder();
3248132480
const textDecoder = new TextDecoder();
32481+
const UNSAFE_SCOPE_PATH_KEYS = new Set([
32482+
"__proto__",
32483+
"constructor",
32484+
"prototype",
32485+
]);
3248232486
/**
3248332487
* Host-side wrapper around one AngularTS scope exposed to Wasm clients.
3248432488
*
@@ -32933,6 +32937,9 @@
3293332937
return scope;
3293432938
}
3293532939
const keys = scopePathKeys(path);
32940+
if (!isSafeScopePath(keys)) {
32941+
return undefined;
32942+
}
3293632943
let current = scope;
3293732944
for (let i = 0, l = keys.length; i < l; i++) {
3293832945
if (current === null || current === undefined) {
@@ -32944,7 +32951,7 @@
3294432951
}
3294532952
function writeScopePath(scope, path, value) {
3294632953
const keys = scopePathKeys(path);
32947-
if (keys.length === 0) {
32954+
if (keys.length === 0 || !isSafeScopePath(keys)) {
3294832955
return false;
3294932956
}
3295032957
let current = scope;
@@ -32964,7 +32971,7 @@
3296432971
}
3296532972
function deleteScopePath(scope, path) {
3296632973
const keys = scopePathKeys(path);
32967-
if (keys.length === 0) {
32974+
if (keys.length === 0 || !isSafeScopePath(keys)) {
3296832975
return false;
3296932976
}
3297032977
let current = scope;
@@ -32980,6 +32987,9 @@
3298032987
function scopePathKeys(path) {
3298132988
return path.split(".").filter(Boolean);
3298232989
}
32990+
function isSafeScopePath(keys) {
32991+
return keys.every((key) => !UNSAFE_SCOPE_PATH_KEYS.has(key));
32992+
}
3298332993

3298432994
/**
3298532995
* Runtime identity and DOM globals.
@@ -33327,17 +33337,16 @@
3332733337
}
3332833338

3332933339
/**
33330-
* Creates a side-effect-free AngularTS runtime with no built-in modules.
33340+
* Creates an AngularTS runtime with no built-in modules.
3333133341
*/
3333233342
function createAngularBare(options = {}) {
3333333343
return new AngularRuntime({
33334-
attachToWindow: false,
3333533344
registerBuiltins: false,
3333633345
...options,
3333733346
});
3333833347
}
3333933348
/**
33340-
* Creates a side-effect-free AngularTS runtime with a custom `ng` module.
33349+
* Creates an AngularTS runtime with a custom `ng` module.
3334133350
*/
3334233351
function createAngularCustom(options = {}) {
3334333352
const angular = createAngularBare(options);

dist/angular-ts.umd.min.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.

dist/angular-ts.umd.min.js.gz

101 KB
Binary file not shown.

dist/angular-ts.umd.min.js.map

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

dist/directive/events/events.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const ngEventDirectives = EVENT_NAMES.reduce((directives, eventName) => {
5252
createEventDirectiveFactory(eventName);
5353
return directives;
5454
}, {});
55+
const ngClickDirective = ngEventDirectives.ngClick;
5556
/**
5657
* Creates a directive that evaluates an expression when the element event fires.
5758
*/
@@ -109,4 +110,4 @@ function createWindowEventDirective($parse, $exceptionHandler, $window, directiv
109110
};
110111
}
111112

112-
export { createEventDirective, createWindowEventDirective, ngEventDirectives };
113+
export { createEventDirective, createWindowEventDirective, ngClickDirective, ngEventDirectives };

dist/externs/angular.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* @externs
3-
* Public externs for AngularTS 0.27.0 applications compiled with Google Closure.
3+
* Public externs for AngularTS 0.28.0 applications compiled with Google Closure.
44
*
5-
* Version-pinned to @angular-wave/angular.ts 0.27.0; regenerate
5+
* Version-pinned to @angular-wave/angular.ts 0.28.0; regenerate
66
* this file when updating the public ng namespace.
77
*
88
* This file is generated from src/namespace.ts by
@@ -3297,17 +3297,11 @@ ng.AngularElementOptions.prototype.elementModule;
32973297
ng.AngularElementOptions.prototype.component;
32983298

32993299
/**
3300-
* Treat this instance as a sub-application. Sub-applications do not attach to `window.angular` by default.
3300+
* Treat this instance as a sub-application.
33013301
* @type {(boolean|undefined)}
33023302
*/
33033303
ng.AngularElementOptions.prototype.subapp;
33043304

3305-
/**
3306-
* Assign the runtime instance to `window.angular`. Defaults to `true` for root apps and `false` for sub-applications.
3307-
* @type {(boolean|undefined)}
3308-
*/
3309-
ng.AngularElementOptions.prototype.attachToWindow;
3310-
33113305
/**
33123306
* Register the configured built-in `ng` module during construction. Custom builds should pass `false` and register their own `ng` module.
33133307
* @type {(boolean|undefined)}

dist/runtime/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ import { registerCustomNgModule } from './custom-ng.js';
33
export { coreProviders } from './custom-ng.js';
44

55
/**
6-
* Creates a side-effect-free AngularTS runtime with no built-in modules.
6+
* Creates an AngularTS runtime with no built-in modules.
77
*/
88
function createAngularBare(options = {}) {
99
return new AngularRuntime({
10-
attachToWindow: false,
1110
registerBuiltins: false,
1211
...options,
1312
});
1413
}
1514
/**
16-
* Creates a side-effect-free AngularTS runtime with a custom `ng` module.
15+
* Creates an AngularTS runtime with a custom `ng` module.
1716
*/
1817
function createAngularCustom(options = {}) {
1918
const angular = createAngularBare(options);

dist/runtime/web-component.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { WebComponentProvider } from '../services/web-component/web-component.js
66
/**
77
* Defines a standalone AngularTS-backed custom element.
88
*
9-
* The helper creates a side-effect-free custom runtime, installs the
10-
* `$webComponent` provider, creates a small application module, and eagerly
9+
* The helper creates a custom runtime, installs the `$webComponent` provider,
10+
* creates a small application module, and eagerly
1111
* builds an injector so the native custom element can be consumed by any host
1212
* framework without calling `angular.bootstrap`.
1313
*/
@@ -29,17 +29,7 @@ function defineAngularElement(name, options) {
2929
const appModule = angular.module(elementModuleName, elementModule?.requires ?? []);
3030
elementModule?.configure?.(appModule, angular);
3131
appModule.appComponent(name, component);
32-
const previousAngular = window.angular;
33-
window.angular = angular;
34-
let injector;
35-
try {
36-
injector = angular.injector([ngModuleName, elementModuleName]);
37-
}
38-
finally {
39-
if (!runtimeOptions.attachToWindow) {
40-
window.angular = previousAngular;
41-
}
42-
}
32+
const injector = angular.injector([ngModuleName, elementModuleName]);
4333
angular.$rootScope = injector.get(_rootScope);
4434
const element = customElements.get(name);
4535
if (!element) {
@@ -58,7 +48,6 @@ function defineAngularElement(name, options) {
5848
const createAngularElement = defineAngularElement;
5949
function createAngularElementRuntime(options) {
6050
const angular = new AngularRuntime({
61-
attachToWindow: false,
6251
registerBuiltins: false,
6352
...options,
6453
});

0 commit comments

Comments
 (0)