@acoustic-content-sdk/ng-utils 中文文档教程
为基于 Angular 的项目实现实用方法和类。
Table of Contents
Home; @acoustic-content-sdk/ng-utils
ng-utils package
Implementation of a utility methods and classes for Angular based projects
Classes
Class | Description |
---|---|
AbstractBaseComponent | Implementation of a base component for Angular Components that expose the renderingContext and layoutMode output observables. |
AbstractLifeCycleComponent | tslint:disable:no-conflicting-lifecycle |
AbstractRenderingComponent | Convenience base class for components that work with a RenderingContextV2 . |
AcNgBrowserWindowModule | Exposes the window as the ACOUSTIC_TOKEN_WINDOW token for the case that the application runs in the browser (as opposed to running on the server via Angular Universal) |
AcNgEditHostWindowModule | Exposes the edit host as the ACOUSTIC_TOKEN_EDIT_HOST_WINDOW token.Depends on: ACOUSTIC_TOKEN_WINDOW |
Functions
Function | Description |
---|---|
proxyGetEditHostWindow(aCurrentWindow) | Returns the window that controls the application |
Variables
Variable | Description |
---|---|
VERSION | Version and build number of the package |
首页 @acoustic-content-sdk/ng-utils > AbstractBaseComponent
AbstractBaseComponent class
实现 Angular 组件的基础组件,公开 renderingContext
和 layoutMode
输出可观察值。
Signature:
export declare abstract class AbstractBaseComponent extends AbstractLifeCycleComponent implements RenderingContextProviderV2
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)() | Constructs a new instance of the AbstractBaseComponent class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
layoutMode | string | Set the layout mode to render this page | |
layoutMode$ | Observable<string> | Fires whenever the layout mode changed, includes the initial default mode. | |
renderingContext$ | Observable<RenderingContextV2> | The rendering context for the page. This is the context of the element that is referenced by the currently active route. |
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent
AbstractLifeCycleComponent class
tslint:disable:no-conflicting-lifecycle
Signature:
export declare abstract class AbstractLifeCycleComponent implements OnInit, OnDestroy, OnChanges, DoCheck, AfterContentInit, AfterContentChecked, AfterViewInit, AfterViewChecked
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
afterContentChecked$ | Observable<void> | AfterContentChecked | |
afterContentInit$ | Observable<void> | AfterContentInit | |
afterViewChecked$ | Observable<void> | AfterViewChecked | |
afterViewInit$ | Observable<void> | AfterViewInit | |
doCheck$ | Observable<void> | DoCheck | |
onChanges$ | Observable<SimpleChanges> | OnChanges | |
onDestroy$ | Observable<void> | OnDestroy | |
onInit$ | Observable<void> | OnInit |
Methods
Method | Modifiers | Description |
---|---|---|
ngAfterContentChecked() | AfterContentChecked | |
ngAfterContentInit() | AfterContentInit | |
ngAfterViewChecked() | AfterViewChecked | |
ngAfterViewInit() | AfterViewInit | |
ngDoCheck() | DoCheck | |
ngOnChanges(changes) | OnChanges | |
ngOnDestroy() | OnDestroy | |
ngOnInit() | {@linkhttps://angular.io/guide/lifecycle-hooks| OnInit} |
主页 > @acoustic-content-sdk/ng-utils > AbstractRenderingComponent
AbstractRenderingComponent class
使用 RenderingContextV2
的组件的便利基类。
Signature:
export declare abstract class AbstractRenderingComponent extends AbstractBaseComponent implements RenderingContextProviderV2
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)() | Our constructor |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
layoutMode$ | Observable<string> | Returns an Observable for the layout mode | |
renderingContext$ | Observable<RenderingContextV2> | Returns an Observable for the rendering context |
Methods
Method | Modifiers | Description |
---|---|---|
trackCtx(aIndex, aCtx) | Generates unique IDs for elements using the following strategy: - if the context is a string, use it as the ID - if the context is an element then … -- if the element contains an 'id' field, use that -- if the element has a '$metadata.id' field, use that -- if the element has a '$metadata.accessor' field, use that -- fall back to the index |
Home > @acoustic-content-sdk/ng-utils > AcNgBrowserWindowModule
AcNgBrowserWindowModule class
将窗口公开为 ACOUSTIC_TOKEN_WINDOW
令牌,用于应用程序在浏览器中运行的情况(相对于通过 Angular 服务器运行)
Signature:
export declare class AcNgBrowserWindowModule
Home > @acoustic-content-sdk/ng-utils > AcNgEditHostWindowModule
AcNgEditHostWindowModule class
将编辑主机公开为 ACOUSTIC_TOKEN_EDIT_HOST_WINDOW
令牌。
Depends on: ACOUSTIC_TOKEN_WINDOW
Signature:
export declare class AcNgEditHostWindowModule
Home > @acoustic-content-sdk/ng-utils > proxyGetEditHostWindow
proxyGetEditHostWindow() function
返回控制应用程序的窗口
签名:
export declare function proxyGetEditHostWindow(aCurrentWindow: WindowType): WindowType;
Parameters
Parameter | Type | Description |
---|---|---|
aCurrentWindow | WindowType | the current window |
返回:
WindowType
控制窗口
Home > @acoustic-content-sdk/ng-utils > VERSION
VERSION variable
Version and build number of the package
Signature:
VERSION: {
version: {
major: string;
minor: string;
patch: string;
branch: string;
};
build: Date;
}
首页 > @acoustic-content-sdk/ng-utils > 抽象基础组件 > (constructor)
AbstractBaseComponent.(constructor)
Constructs a new instance of the AbstractBaseComponent
class
Signature:
protected constructor();
主页 > @acoustic-content-sdk/ng-utils > 抽象基础组件 > layoutMode
AbstractBaseComponent.layoutMode property
Set the layout mode to render this page
Signature:
layoutMode: string;
首页 > @acoustic-content-sdk/ng-utils > 抽象基础组件 > layoutMode$
AbstractBaseComponent.layoutMode$ property
当布局模式改变时触发,包括初始默认模式。
Signature:
readonly layoutMode$: Observable<string>;
Home > @acoustic-content-sdk/ng-utils > 抽象基础组件 > renderingContext$
AbstractBaseComponent.renderingContext$ property
页面的呈现上下文。 这是当前活动路由引用的元素的上下文。
Signature:
renderingContext$: Observable<RenderingContextV2>;
Home > @acoustic-content-sdk/ng-utils > 抽象渲染组件 > (constructor)
AbstractRenderingComponent.(constructor)
Our constructor
Signature:
constructor();
Home< /a> > @acoustic-content-sdk/ng-utils > 抽象渲染组件 > layoutMode$
AbstractRenderingComponent.layoutMode$ property
Returns an Observable for the layout mode
Signature:
readonly layoutMode$: Observable<string>;
首页 > @acoustic-content-sdk/ng-utils > 抽象渲染组件 > renderingContext$
AbstractRenderingComponent.renderingContext$ property
Returns an Observable for the rendering context
Signature:
readonly renderingContext$: Observable<RenderingContextV2>;
首页 > @acoustic-content-sdk/ng-utils > 抽象渲染组件 > trackCtx
AbstractRenderingComponent.trackCtx() method
使用以下策略为元素生成唯一 ID: - 如果上下文是字符串,则将其用作 ID - 如果上下文是元素,则...... - 如果元素包含一个“id”字段,使用它——如果元素有一个“$metadata.id”字段,使用它——如果元素有一个“$metadata.accessor”字段,使用它——返回到index
签名:
trackCtx(aIndex: number, aCtx: RenderingContextInput): string | number;
Parameters
Parameter | Type | Description |
---|---|---|
aIndex | number | index of the iteration |
aCtx | RenderingContextInput | the input |
返回:
string | number
the unique ID
Home > @acoustic-content-sdk/ng-utils > 抽象生命周期组件 > AfterContentChecked$
AbstractLifeCycleComponent.afterContentChecked$ property
签名:
protected get afterContentChecked$(): Observable<void>;
< a name="_1f8ac84799047a698f154566b7be845b59432b0e49d7c5185654061147f0e68d">
Home > @acoustic-content-sdk/ng-utils > 抽象生命周期组件 > afterContentInit$
AbstractLifeCycleComponent.afterContentInit$ property
签名:
protected get afterContentInit$(): Observable<void>;
<一个名字=“_8a32d39e52886016f044ead2db08c14bb3e3a777b91eb26e24f83ed4a4e1e79f”>
@acoustic-content-sdk/ng-utils > 抽象生命周期组件 > afterViewChecked$
AbstractLifeCycleComponent.afterViewChecked$ property
签名:
protected get afterViewChecked$(): Observable<void>;
<一个名字="_df4177b7fcd1ad9077e28acc13dde45e099eeb79f2f99de78dca9a29fe58fb14">
@acoustic-content-sdk/ng-utils > 抽象生命周期组件 > afterViewInit$
AbstractLifeCycleComponent.afterViewInit$ property
签名:
protected get afterViewInit$(): Observable<void>;
<一个名字="_7c8f873cc04d94699b0c279620e88c0830c871be26ef493f83b155329fd12b45">
@acoustic-content-sdk/ng-utils > 抽象生命周期组件 > doCheck$
AbstractLifeCycleComponent.doCheck$ property
签名:
protected get doCheck$(): Observable<void>;
<一个名字=“_05024f7ae59209718ade07eeb6fd5b51f850a61e2a4220bfdbee8807bc773527”>
@acoustic-content-sdk/ng-utils > 抽象生命周期组件 > onChanges$
AbstractLifeCycleComponent.onChanges$ property
签名:
protected get onChanges$(): Observable<SimpleChanges>;
<一个名字=“_eab6a011de126866adfafd407a26a052104c61d92369dc0c72484d4f322ea0ef”>
@acoustic-content-sdk/ng-utils > 抽象生命周期组件 > onDestroy$
AbstractLifeCycleComponent.onDestroy$ property
签名:
protected get onDestroy$(): Observable<void>;
<一个名字="_4deb421c8c13582e093094350e58bccc71917cd9e883a495e94afcf31231d79c">
@acoustic-content-sdk/ng-utils > 抽象生命周期组件 > onInit$
AbstractLifeCycleComponent.onInit$ property
签名:
protected get onInit$(): Observable<void>;
< a name="_d916b59b00525a44c4432a9b08c926a7743eb2b46e0e4c80932a9ba62d789a91">
Home > @acoustic-content-sdk/ng-utils > 抽象生命周期组件 > ngAfterContentChecked
AbstractLifeCycleComponent.ngAfterContentChecked() method
签名:
ngAfterContentChecked(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > 抽象生命周期组件 > ngAfterContentInit
AbstractLifeCycleComponent.ngAfterContentInit() method
签名:
ngAfterContentInit(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > 抽象生命周期组件 > ngAfterViewChecked
AbstractLifeCycleComponent.ngAfterViewChecked() method
签名:
ngAfterViewChecked(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > 抽象生命周期组件 > ngAfterViewInit
AbstractLifeCycleComponent.ngAfterViewInit() method
签名:
ngAfterViewInit(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > 抽象生命周期组件 > ngDoCheck
AbstractLifeCycleComponent.ngDoCheck() method
签名:
ngDoCheck(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > 抽象生命周期组件 > ngOnChanges
AbstractLifeCycleComponent.ngOnChanges() method
签名:
ngOnChanges(changes: SimpleChanges): void;
Parameters
Parameter | Type | Description |
---|---|---|
changes | SimpleChanges |
Returns:
void
Home > @acoustic-content-sdk/ng-utils > 抽象生命周期组件 > ngOnDestroy
AbstractLifeCycleComponent.ngOnDestroy() method
签名:
ngOnDestroy(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > 抽象生命周期组件 > ngOnInit
AbstractLifeCycleComponent.ngOnInit() method
{@链接https://angular.io/guide/lifecycle-hooks| OnInit}
签名:
ngOnInit(): void;
返回:
void
Implementation of a utility methods and classes for Angular based projects.
Table of Contents
Home > @acoustic-content-sdk/ng-utils
ng-utils package
Implementation of a utility methods and classes for Angular based projects
Classes
Class | Description |
---|---|
AbstractBaseComponent | Implementation of a base component for Angular Components that expose the renderingContext and layoutMode output observables. |
AbstractLifeCycleComponent | tslint:disable:no-conflicting-lifecycle |
AbstractRenderingComponent | Convenience base class for components that work with a RenderingContextV2 . |
AcNgBrowserWindowModule | Exposes the window as the ACOUSTIC_TOKEN_WINDOW token for the case that the application runs in the browser (as opposed to running on the server via Angular Universal) |
AcNgEditHostWindowModule | Exposes the edit host as the ACOUSTIC_TOKEN_EDIT_HOST_WINDOW token.Depends on: ACOUSTIC_TOKEN_WINDOW |
Functions
Function | Description |
---|---|
proxyGetEditHostWindow(aCurrentWindow) | Returns the window that controls the application |
Variables
Variable | Description |
---|---|
VERSION | Version and build number of the package |
Home > @acoustic-content-sdk/ng-utils > AbstractBaseComponent
AbstractBaseComponent class
Implementation of a base component for Angular Components that expose the renderingContext
and layoutMode
output observables.
Signature:
export declare abstract class AbstractBaseComponent extends AbstractLifeCycleComponent implements RenderingContextProviderV2
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)() | Constructs a new instance of the AbstractBaseComponent class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
layoutMode | string | Set the layout mode to render this page | |
layoutMode$ | Observable<string> | Fires whenever the layout mode changed, includes the initial default mode. | |
renderingContext$ | Observable<RenderingContextV2> | The rendering context for the page. This is the context of the element that is referenced by the currently active route. |
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent
AbstractLifeCycleComponent class
tslint:disable:no-conflicting-lifecycle
Signature:
export declare abstract class AbstractLifeCycleComponent implements OnInit, OnDestroy, OnChanges, DoCheck, AfterContentInit, AfterContentChecked, AfterViewInit, AfterViewChecked
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
afterContentChecked$ | Observable<void> | AfterContentChecked | |
afterContentInit$ | Observable<void> | AfterContentInit | |
afterViewChecked$ | Observable<void> | AfterViewChecked | |
afterViewInit$ | Observable<void> | AfterViewInit | |
doCheck$ | Observable<void> | DoCheck | |
onChanges$ | Observable<SimpleChanges> | OnChanges | |
onDestroy$ | Observable<void> | OnDestroy | |
onInit$ | Observable<void> | OnInit |
Methods
Method | Modifiers | Description |
---|---|---|
ngAfterContentChecked() | AfterContentChecked | |
ngAfterContentInit() | AfterContentInit | |
ngAfterViewChecked() | AfterViewChecked | |
ngAfterViewInit() | AfterViewInit | |
ngDoCheck() | DoCheck | |
ngOnChanges(changes) | OnChanges | |
ngOnDestroy() | OnDestroy | |
ngOnInit() | {@linkhttps://angular.io/guide/lifecycle-hooks| OnInit} |
Home > @acoustic-content-sdk/ng-utils > AbstractRenderingComponent
AbstractRenderingComponent class
Convenience base class for components that work with a RenderingContextV2
.
Signature:
export declare abstract class AbstractRenderingComponent extends AbstractBaseComponent implements RenderingContextProviderV2
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)() | Our constructor |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
layoutMode$ | Observable<string> | Returns an Observable for the layout mode | |
renderingContext$ | Observable<RenderingContextV2> | Returns an Observable for the rendering context |
Methods
Method | Modifiers | Description |
---|---|---|
trackCtx(aIndex, aCtx) | Generates unique IDs for elements using the following strategy: - if the context is a string, use it as the ID - if the context is an element then … -- if the element contains an 'id' field, use that -- if the element has a '$metadata.id' field, use that -- if the element has a '$metadata.accessor' field, use that -- fall back to the index |
Home > @acoustic-content-sdk/ng-utils > AcNgBrowserWindowModule
AcNgBrowserWindowModule class
Exposes the window as the ACOUSTIC_TOKEN_WINDOW
token for the case that the application runs in the browser (as opposed to running on the server via Angular Universal)
Signature:
export declare class AcNgBrowserWindowModule
Home > @acoustic-content-sdk/ng-utils > AcNgEditHostWindowModule
AcNgEditHostWindowModule class
Exposes the edit host as the ACOUSTIC_TOKEN_EDIT_HOST_WINDOW
token.
Depends on: ACOUSTIC_TOKEN_WINDOW
Signature:
export declare class AcNgEditHostWindowModule
Home > @acoustic-content-sdk/ng-utils > proxyGetEditHostWindow
proxyGetEditHostWindow() function
Returns the window that controls the application
Signature:
export declare function proxyGetEditHostWindow(aCurrentWindow: WindowType): WindowType;
Parameters
Parameter | Type | Description |
---|---|---|
aCurrentWindow | WindowType | the current window |
Returns:
WindowType
the controlling window
Home > @acoustic-content-sdk/ng-utils > VERSION
VERSION variable
Version and build number of the package
Signature:
VERSION: {
version: {
major: string;
minor: string;
patch: string;
branch: string;
};
build: Date;
}
Home > @acoustic-content-sdk/ng-utils > AbstractBaseComponent > (constructor)
AbstractBaseComponent.(constructor)
Constructs a new instance of the AbstractBaseComponent
class
Signature:
protected constructor();
Home > @acoustic-content-sdk/ng-utils > AbstractBaseComponent > layoutMode
AbstractBaseComponent.layoutMode property
Set the layout mode to render this page
Signature:
layoutMode: string;
Home > @acoustic-content-sdk/ng-utils > AbstractBaseComponent > layoutMode$
AbstractBaseComponent.layoutMode$ property
Fires whenever the layout mode changed, includes the initial default mode.
Signature:
readonly layoutMode$: Observable<string>;
Home > @acoustic-content-sdk/ng-utils > AbstractBaseComponent > renderingContext$
AbstractBaseComponent.renderingContext$ property
The rendering context for the page. This is the context of the element that is referenced by the currently active route.
Signature:
renderingContext$: Observable<RenderingContextV2>;
Home > @acoustic-content-sdk/ng-utils > AbstractRenderingComponent > (constructor)
AbstractRenderingComponent.(constructor)
Our constructor
Signature:
constructor();
Home > @acoustic-content-sdk/ng-utils > AbstractRenderingComponent > layoutMode$
AbstractRenderingComponent.layoutMode$ property
Returns an Observable for the layout mode
Signature:
readonly layoutMode$: Observable<string>;
Home > @acoustic-content-sdk/ng-utils > AbstractRenderingComponent > renderingContext$
AbstractRenderingComponent.renderingContext$ property
Returns an Observable for the rendering context
Signature:
readonly renderingContext$: Observable<RenderingContextV2>;
Home > @acoustic-content-sdk/ng-utils > AbstractRenderingComponent > trackCtx
AbstractRenderingComponent.trackCtx() method
Generates unique IDs for elements using the following strategy: - if the context is a string, use it as the ID - if the context is an element then … -- if the element contains an 'id' field, use that -- if the element has a '$metadata.id' field, use that -- if the element has a '$metadata.accessor' field, use that -- fall back to the index
Signature:
trackCtx(aIndex: number, aCtx: RenderingContextInput): string | number;
Parameters
Parameter | Type | Description |
---|---|---|
aIndex | number | index of the iteration |
aCtx | RenderingContextInput | the input |
Returns:
string | number
the unique ID
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > afterContentChecked$
AbstractLifeCycleComponent.afterContentChecked$ property
Signature:
protected get afterContentChecked$(): Observable<void>;
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > afterContentInit$
AbstractLifeCycleComponent.afterContentInit$ property
Signature:
protected get afterContentInit$(): Observable<void>;
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > afterViewChecked$
AbstractLifeCycleComponent.afterViewChecked$ property
Signature:
protected get afterViewChecked$(): Observable<void>;
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > afterViewInit$
AbstractLifeCycleComponent.afterViewInit$ property
Signature:
protected get afterViewInit$(): Observable<void>;
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > doCheck$
AbstractLifeCycleComponent.doCheck$ property
Signature:
protected get doCheck$(): Observable<void>;
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > onChanges$
AbstractLifeCycleComponent.onChanges$ property
Signature:
protected get onChanges$(): Observable<SimpleChanges>;
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > onDestroy$
AbstractLifeCycleComponent.onDestroy$ property
Signature:
protected get onDestroy$(): Observable<void>;
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > onInit$
AbstractLifeCycleComponent.onInit$ property
Signature:
protected get onInit$(): Observable<void>;
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > ngAfterContentChecked
AbstractLifeCycleComponent.ngAfterContentChecked() method
Signature:
ngAfterContentChecked(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > ngAfterContentInit
AbstractLifeCycleComponent.ngAfterContentInit() method
Signature:
ngAfterContentInit(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > ngAfterViewChecked
AbstractLifeCycleComponent.ngAfterViewChecked() method
Signature:
ngAfterViewChecked(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > ngAfterViewInit
AbstractLifeCycleComponent.ngAfterViewInit() method
Signature:
ngAfterViewInit(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > ngDoCheck
AbstractLifeCycleComponent.ngDoCheck() method
Signature:
ngDoCheck(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > ngOnChanges
AbstractLifeCycleComponent.ngOnChanges() method
Signature:
ngOnChanges(changes: SimpleChanges): void;
Parameters
Parameter | Type | Description |
---|---|---|
changes | SimpleChanges |
Returns:
void
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > ngOnDestroy
AbstractLifeCycleComponent.ngOnDestroy() method
Signature:
ngOnDestroy(): void;
Returns:
void
Home > @acoustic-content-sdk/ng-utils > AbstractLifeCycleComponent > ngOnInit
AbstractLifeCycleComponent.ngOnInit() method
{@linkhttps://angular.io/guide/lifecycle-hooks| OnInit}
Signature:
ngOnInit(): void;
Returns:
void
你可能也喜欢
- 4screens-permissions 中文文档教程
- @0x4447/potato 中文文档教程
- @0xsaturn/protocols 中文文档教程
- @11ty/eleventy-plugin-rss 中文文档教程
- @1onlinesolution/dws-hermes 中文文档教程
- @2hats/react-native-linear-gradient 中文文档教程
- @3dorchard/generator-typescript-boilerplate 中文文档教程
- @3test/ethereum-http-provider 中文文档教程
- @4awpawz/trio 中文文档教程
- @7span/styles 中文文档教程