@acoustic-content-sdk/ng-api 中文文档教程
声学内容服务的 Angular 特定 API 和注入令牌。
Home > @acoustic-content-sdk/ng-api
ng-api package
Collection of APIs and constants for the Angular SDK
Enumerations
Enumeration | Description |
---|---|
PROVIDER_WEIGHT |
Interfaces
Interface | Description |
---|---|
AcNgPageService | Service interface that allows to resolve a rendering context given the page. |
ComponentRegistry | Service to register components and get information about registered components. |
ComponentResolver | |
ComponentTypeRef | Captures all information required to instantiate a component based on its type |
ComponentTypeRefResolver | Service that resolves a component type ref given a layout. |
Variables
Variable | Description |
---|---|
ACOUSTIC_RC_INTERCEPTOR_TOKEN | |
ACOUSTIC_TOKEN_ACTIVE_PAGE | Injection token for the page service |
ACOUSTIC_TOKEN_API_URL | URL to access the API layerNaming of this field according to the field in the rendering context |
ACOUSTIC_TOKEN_AUTH_STATUS | Injection token for the page service |
ACOUSTIC_TOKEN_BASE_URL | URL that represents the base URL of the path based routing of the application. This prefix will be preserved when generating and recognizing URLs. If this property is not configured, then it will be decoded from the window location. |
ACOUSTIC_TOKEN_COMPONENT_REGISTRY | Injection token for the component registry |
ACOUSTIC_TOKEN_COMPONENT_TYPE_REF_RESOLVERS | A multi-provider token used for dependency injection of the ComponentTypeRefResolvers. |
ACOUSTIC_TOKEN_DELIVERY_CONTENT_RESOLVER | Injection token for the page service |
ACOUSTIC_TOKEN_DELIVERY_CONTENT_SEED | Injection token for the page service |
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_MAPPING_RESOLVER | Injection token for the page service |
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_MAPPING_SEED | Injection token for the page service |
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_RESOLVER | Injection token for the page service |
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_SEED | Injection token for the page service |
ACOUSTIC_TOKEN_DELIVERY_PAGE_RESOLVER | Injection token for the page service |
ACOUSTIC_TOKEN_DELIVERY_PAGE_SEED | Injection token for the page service |
ACOUSTIC_TOKEN_DELIVERY_SEARCH_RESOLVER | Injection token for the navigation service |
ACOUSTIC_TOKEN_DELIVERY_SITE_RESOLVER | Injection token for the navigation service |
ACOUSTIC_TOKEN_DELIVERY_TYPE_RESOLVER | Injection token for the page service |
ACOUSTIC_TOKEN_DELIVERY_TYPE_SEED | Injection token for the page service |
ACOUSTIC_TOKEN_DYNAMIC_LOGGER_FACTORY | |
ACOUSTIC_TOKEN_HANDLEBARS_RESOLVER | Injection token for the page service |
ACOUSTIC_TOKEN_LAYOUT_RESOLVER | Injection token for the page service |
ACOUSTIC_TOKEN_LOGGER_FACTORY | |
ACOUSTIC_TOKEN_LOGGER_SERVICE | |
ACOUSTIC_TOKEN_PAGE_SERVICE | Injection token for the page service |
ACOUSTIC_TOKEN_PRE_RENDERING_RESOLVER | Injection token for the pre rendering service |
ACOUSTIC_TOKEN_PROTECTED_CONTENT | Injection token for the protected content status |
ACOUSTIC_TOKEN_RENDERING_CONTEXT_PROVIDER | Injection token for the rendering context provider |
ACOUSTIC_TOKEN_RENDERING_CONTEXT_RESOLVER | Injection token for the RenderingContextResolver |
ACOUSTIC_TOKEN_RESOURCE_URL | URL to access the deliveryNaming of this field according to the field in the rendering context |
ACOUSTIC_TOKEN_SEED_RESOLVER | Injection token for the page service |
ACOUSTIC_TOKEN_URL_CONFIG | Injection token for the url config |
ACOUSTIC_TOKEN_WINDOW | Create a new injection token for injecting the window into a component. |
VERSION | Version and build number of the package |
Type Aliases
Type Alias | Description |
---|---|
ExtractInjectionTokenType | Type that extracts the type of an injection token |
主页 > @acoustic-content-sdk/ng-api > PROVIDER_WEIGHT
PROVIDER_WEIGHT enum
Signature:
export declare enum PROVIDER_WEIGHT
Enumeration Members
Member | Value | Description |
---|---|---|
HEIGH | 3000 |
|
LOW | 1000 |
|
MAX |
|
|
MEDIUM | 2000 |
|
MIN |
|
Home > ; @acoustic-content-sdk/ng-api > AcNgPageService
AcNgPageService interface
允许解析给定页面的呈现上下文的服务接口。
Signature:
export interface AcNgPageService extends WchPageService
Methods
Method | Description |
---|---|
getRenderingContextByActivatedRoute(aRoute) | Resolves the rendering context given the router |
getRenderingContextByUrlSegments(aSegments) | Resolves the rendering context given the url segments |
Home > @acoustic-content-sdk/ng-api > ComponentRegistry
ComponentRegistry interface
注册组件并获取有关已注册组件信息的服务。
Signature:
export interface ComponentRegistry extends AbstractComponentsRegistry<ComponentTypeRef<any>>
Methods
Method | Description |
---|---|
registerType(aController, aType, aLayoutModes) | Registers the type given a full spec |
registerType(aType) | Registers the type and assumes that a decorator has specified the controller |
registerType(aType) | Registers the type and assumes that a decorator has specified the controller |
Home > @acoustic-content-sdk/ng-api > ComponentResolver
ComponentResolver interface
Signature:
export interface ComponentResolver extends AbstractComponentResolver<ComponentTypeRef<any>>
Methods
Method | Description |
---|---|
resolveComponent(aRenderingContext, aLayoutMode) |
Home > ; @acoustic-content-sdk/ng-api > ComponentTypeRef
ComponentTypeRef interface
Captures all information required to instantiate a component based on its type
Signature:
export interface ComponentTypeRef<T>
Properties
Property | Type | Description |
---|---|---|
resolver | ComponentFactoryResolver |
Optionally a component factory resolver |
type | Type<T> |
The actual angular type for the component |
主页 > @acoustic-content-sdk/ng-api > ComponentTypeRefResolver
ComponentTypeRefResolver interface
解析给定布局的组件类型引用的服务。
Signature:
export interface ComponentTypeRefResolver extends AbstractComponentTypeRefResolver<ComponentTypeRef<any>>
Properties
Property | Type | Description |
---|---|---|
getTypeByLayout | (aLayout: Layout, aLayoutMode?: string) => Observable<ComponentTypeRef<any>> |
Returns the type object based on the layout configuration |
weight | number |
Optionally a weight for the resolver |
Home > @acoustic-content-sdk/ng-api > ACOUSTIC_RC_INTERCEPTOR_TOKEN
ACOUSTIC_RC_INTERCEPTOR_TOKEN variable
Signature:
ACOUSTIC_RC_INTERCEPTOR_TOKEN = "8453750A-4519-4184-840B-D490E909D23E"
Home > ; @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_ACTIVE_PAGE
ACOUSTIC_TOKEN_ACTIVE_PAGE variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_ACTIVE_PAGE: InjectionToken<ActivePageV2>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_API_URL
ACOUSTIC_TOKEN_API_URL variable
访问API层的URL
根据渲染上下文中的字段命名该字段
Signature:
ACOUSTIC_TOKEN_API_URL: InjectionToken<HubInfoUrlProvider>
Example 1
'https://my.digitalexperience. ibm.com/api/345563cf-a83c-40e5-a065-1d6ff36b05c1'
Example 2
'https://my.digitalexperience.ibm.com/api/345563cf-a83c-40e5-a065-1d6ff36b05c1/dxsites/mysite'
d>d2e60d"> @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_AUTH_STATUS
ACOUSTIC_TOKEN_AUTH_STATUS variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_AUTH_STATUS: InjectionToken<AuthStatus>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_BASE_URL
ACOUSTIC_TOKEN_BASE_URL variable
表示应用程序基于路径的路由的基本 URL 的 URL。 生成和识别 URL 时将保留此前缀。 如果未配置此属性,则将从窗口位置解码。
签名:
ACOUSTIC_TOKEN_BASE_URL: InjectionToken<HubInfoUrlProvider>
Example 1
'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1'
Example 2
'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5 -a065-1d6ff36b05c1/dxsites/mysite'
Example 3
'https://my.external.example.com/'
Home > ; @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_COMPONENT_REGISTRY
ACOUSTIC_TOKEN_COMPONENT_REGISTRY variable
Injection token for the component registry
Signature:
ACOUSTIC_TOKEN_COMPONENT_REGISTRY: InjectionToken<ComponentRegistry>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_COMPONENT_TYPE_REF_RESOLVERS
ACOUSTIC_TOKEN_COMPONENT_TYPE_REF_RESOLVERS variable
A multi-provider token used for dependency injection of the ComponentTypeRefResolvers.
Signature:
ACOUSTIC_TOKEN_COMPONENT_TYPE_REF_RESOLVERS: InjectionToken<ComponentTypeRefResolver[]>
Example
providers: [
{
provide: ACOUSTIC_TOKEN_COMPONENT_TYPE_REF_RESOLVERS,
useClass: MyResolver,
multi: true
}
]
Home > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_CONTENT_RESOLVER
ACOUSTIC_TOKEN_DELIVERY_CONTENT_RESOLVER variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_DELIVERY_CONTENT_RESOLVER: InjectionToken<DeliveryContentResolver>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_CONTENT_SEED
ACOUSTIC_TOKEN_DELIVERY_CONTENT_SEED variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_DELIVERY_CONTENT_SEED: InjectionToken<string>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_LAYOUT_MAPPING_RESOLVER
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_MAPPING_RESOLVER variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_MAPPING_RESOLVER: InjectionToken<DeliveryLayoutMappingResolver>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_LAYOUT_MAPPING_SEED
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_MAPPING_SEED variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_MAPPING_SEED: InjectionToken<string>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_LAYOUT_RESOLVER
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_RESOLVER variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_RESOLVER: InjectionToken<DeliveryLayoutResolver>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_LAYOUT_SEED
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_SEED variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_DELIVERY_LAYOUT_SEED: InjectionToken<string>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_PAGE_RESOLVER
ACOUSTIC_TOKEN_DELIVERY_PAGE_RESOLVER variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_DELIVERY_PAGE_RESOLVER: InjectionToken<DeliveryPageResolver>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_PAGE_SEED
ACOUSTIC_TOKEN_DELIVERY_PAGE_SEED variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_DELIVERY_PAGE_SEED: InjectionToken<string>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_SEARCH_RESOLVER
ACOUSTIC_TOKEN_DELIVERY_SEARCH_RESOLVER variable
Injection token for the navigation service
Signature:
ACOUSTIC_TOKEN_DELIVERY_SEARCH_RESOLVER: InjectionToken<DeliverySearchResolver>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_SITE_RESOLVER
ACOUSTIC_TOKEN_DELIVERY_SITE_RESOLVER variable
Injection token for the navigation service
Signature:
ACOUSTIC_TOKEN_DELIVERY_SITE_RESOLVER: InjectionToken<DeliverySiteResolver>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_TYPE_RESOLVER
ACOUSTIC_TOKEN_DELIVERY_TYPE_RESOLVER variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_DELIVERY_TYPE_RESOLVER: InjectionToken<DeliveryTypeResolver>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DELIVERY_TYPE_SEED
ACOUSTIC_TOKEN_DELIVERY_TYPE_SEED variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_DELIVERY_TYPE_SEED: InjectionToken<string>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_DYNAMIC_LOGGER_FACTORY
ACOUSTIC_TOKEN_DYNAMIC_LOGGER_FACTORY variable
Signature:
ACOUSTIC_TOKEN_DYNAMIC_LOGGER_FACTORY: InjectionToken<DynamicLoggerFactory>
Home > ; @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_HANDLEBARS_RESOLVER
ACOUSTIC_TOKEN_HANDLEBARS_RESOLVER variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_HANDLEBARS_RESOLVER: InjectionToken<HandlebarsResolver>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_LAYOUT_RESOLVER
ACOUSTIC_TOKEN_LAYOUT_RESOLVER variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_LAYOUT_RESOLVER: InjectionToken<LayoutResolver>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_LOGGER_FACTORY
ACOUSTIC_TOKEN_LOGGER_FACTORY variable
Signature:
ACOUSTIC_TOKEN_LOGGER_FACTORY: InjectionToken<LoggerFactory>
Home > ; @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_LOGGER_SERVICE
ACOUSTIC_TOKEN_LOGGER_SERVICE variable
Signature:
ACOUSTIC_TOKEN_LOGGER_SERVICE: InjectionToken<LoggerService>
Home > ; @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_PAGE_SERVICE
ACOUSTIC_TOKEN_PAGE_SERVICE variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_PAGE_SERVICE: InjectionToken<AcNgPageService>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_PRE_RENDERING_RESOLVER
ACOUSTIC_TOKEN_PRE_RENDERING_RESOLVER variable
Injection token for the pre rendering service
Signature:
ACOUSTIC_TOKEN_PRE_RENDERING_RESOLVER: InjectionToken<PreRenderingResolver>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_PROTECTED_CONTENT
ACOUSTIC_TOKEN_PROTECTED_CONTENT variable
Injection token for the protected content status
Signature:
ACOUSTIC_TOKEN_PROTECTED_CONTENT: InjectionToken<ProtectedContent>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_RENDERING_CONTEXT_PROVIDER
ACOUSTIC_TOKEN_RENDERING_CONTEXT_PROVIDER variable
Injection token for the rendering context provider
Signature:
ACOUSTIC_TOKEN_RENDERING_CONTEXT_PROVIDER: InjectionToken<RenderingContextProviderV2>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_RENDERING_CONTEXT_RESOLVER
ACOUSTIC_TOKEN_RENDERING_CONTEXT_RESOLVER variable
Injection token for the RenderingContextResolver
Signature:
ACOUSTIC_TOKEN_RENDERING_CONTEXT_RESOLVER: InjectionToken<RenderingContextResolver>
Home > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_RESOURCE_URL
ACOUSTIC_TOKEN_RESOURCE_URL variable
URL to access the delivery
此字段根据渲染上下文中的字段命名
Signature:
ACOUSTIC_TOKEN_RESOURCE_URL: InjectionToken<HubInfoUrlProvider>
Example 1
'https://my.ibdigitalexperience .com/345563cf-a83c-40e5-a065-1d6ff36b05c1'
Example 2
'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1/dxsites/mysite'
主页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_SEED_RESOLVER
ACOUSTIC_TOKEN_SEED_RESOLVER variable
Injection token for the page service
Signature:
ACOUSTIC_TOKEN_SEED_RESOLVER: InjectionToken<SeedResolver>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_URL_CONFIG
ACOUSTIC_TOKEN_URL_CONFIG variable
Injection token for the url config
Signature:
ACOUSTIC_TOKEN_URL_CONFIG: InjectionToken<Observable<UrlConfig>>
首页 > @acoustic-content-sdk/ng-api > ACOUSTIC_TOKEN_WINDOW
ACOUSTIC_TOKEN_WINDOW variable
创建一个新的注入令牌,用于将窗口注入组件。
Signature:
ACOUSTIC_TOKEN_WINDOW: InjectionToken<WindowType>
Home > @acoustic-content-sdk/ng-api > 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-api > ExtractInjectionTokenType
ExtractInjectionTokenType type
Type that extracts the type of an injection token
Signature:
export declare type ExtractInjectionTokenType<T extends InjectionToken<any>> = T extends InjectionToken<infer F> ? F : never;
主页 > @acoustic-content-sdk/ng-api > 组件注册表 > registerType
ComponentRegistry.registerType() method
注册给定完整规范的类型
签名:
registerType(aController: string | string[], aType: ComponentTypeRef<any>, aLayoutModes?: string | string[]): void;
Parameters
Parameter | Type | Description |
---|---|---|
aController | string | string[] |
|
aType | ComponentTypeRef<any> |
|
aLayoutModes | string | string[] |
返回:
void
首页 @acoustic-content-sdk/ng-api > 组件注册表 > registerType
ComponentRegistry.registerType() method
注册类型并假定装饰器已指定控制器
签名:
registerType(aType: ComponentTypeRef<any>): void;
Parameters
Parameter | Type | Description |
---|---|---|
aType | ComponentTypeRef<any> |
返回:
void
Home @acoustic-content-sdk/ng-api > 组件注册表 > registerType
ComponentRegistry.registerType() method
注册类型并假定装饰器已指定控制器
签名:
registerType(aType: Type<any>): void;
Parameters
Parameter | Type | Description |
---|---|---|
aType | Type<any> |
返回:
void
@acoustic-content-sdk/ng-api > AcNgPageService > getRenderingContextByActivatedRoute
AcNgPageService.getRenderingContextByActivatedRoute() method
解析给定路由器的呈现上下文
签名:
getRenderingContextByActivatedRoute(aRoute: ActivatedRoute): Observable<RenderingContextV2 | null | undefined>;
Parameters
Parameter | Type | Description |
---|---|---|
aRoute | ActivatedRoute |
the activated route |
返回:
ObservableContext
the observable of the rendering context or undefined if it could not be found
Home > @acoustic-content-sdk/ng-api > AcNgPageService > getRenderingContextByUrlSegments
AcNgPageService.getRenderingContextByUrlSegments() method
解析给定 url 段的呈现上下文
签名:
getRenderingContextByUrlSegments(aSegments: UrlSegment[]): Observable<RenderingContextV2 | null | undefined>;
Parameters
Parameter | Type | Description |
---|---|---|
aSegments | UrlSegment[] |
the segments |
返回:
the observable of the rendering context or undefined if it could not be found
Home > @acoustic-content-sdk/ng-api > 组件解析器 > resolveComponent
ComponentResolver.resolveComponent() method
签名:
resolveComponent(aRenderingContext: RenderingContextV2, aLayoutMode?: string): Observable<ComponentTypeRef<any>>;
Parameters
Parameter | Type | Description |
---|---|---|
aRenderingContext | RenderingContextV2 |
|
aLayoutMode | string |
返回:
Observable
首页 3706 @acoustic-content-sdk/ng-api > ComponentTypeRefResolver > getTypeByLayout
ComponentTypeRefResolver.getTypeByLayout property
Returns the type object based on the layout configuration
Signature:
getTypeByLayout: (aLayout: Layout, aLayoutMode?: string) => Observable<ComponentTypeRef<any>>;
主页 > @acoustic-content-sdk/ng-api > ComponentTypeRefResolver > weight
ComponentTypeRefResolver.weight property
Optionally a weight for the resolver
Signature:
weight?: number;
首页 > @acoustic-content-sdk/ng-api > ComponentTypeRef > resolver
ComponentTypeRef.resolver property
Optionally a component factory resolver
Signature:
resolver?: ComponentFactoryResolver;
Home > @acoustic-content-sdk/ng-api > ComponentTypeRef > type
ComponentTypeRef.type property
组件的实际角度类型
Signature:
type: Type<T>;