Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@orchestrator/core
Advanced tools
Core package of Orchestrator library.
It is providing capabilities to render UIs dynamically from a JSON like configurations using Angular components that are registered with it.
First you should create some component that you want to be able to render.
To do that - just decorate your component with @DynamicComponent
decorator
and pass an object with required class that describes it's configuration
and use interface OrchestratorDynamicComponent
that describes inputs:
import { Component, Input } from '@angular/core';
import {
DynamicComponent,
OrchestratorDynamicComponent,
Option,
} from '@orchestrator/core';
export class YourComponentConfig {
@Option()
title?: string;
}
@Component({
selector: 'your-dynamic-component',
template: `Title is {{ config?.title }}`,
})
@DynamicComponent({ config: YourComponentConfig })
export class YourDynamicComponent
implements OrchestratorDynamicComponent<YourComponentConfig>
{
@Input()
items?: OrchestratorConfigItem<any>[];
@Input()
config?: YourComponentConfig;
@Input()
context?: any;
}
config
input is a config validated at runtime of your component
that is provided via the JSON like config for each componentcontext
input is any object that is passed down as a context from the topitems
input contains further children of a JSON like subtree
that your component may or may not decide to renderNext, you should tell Orchestrator which components are available for render.
To do that - just call OrchestratorCoreModule.withComponents([...])
with your components in your application module:
import { NgModule } from '@angular/core';
import { OrchestratorCoreModule } from '@orchestrator/core';
import { YourDynamicComponent } from './your-dynamic.component.ts';
@NgModule({
imports: [OrchestratorCoreModule.withComponents([YourDynamicComponent])],
})
export class AppModule {}
Finally you are ready to render UI dynamically using <orc-orchestrator>
component
and passing to it JSON like configuration of your UI:
import { Component } from '@angular/core';
import { OrchestratorConfigItem } from '@orchestrator/core';
@Component({
template: `<orc-orchestrator [config]="config"></orc-orchestrator>`,
})
export class MyComponent {
config: OrchestratorConfigItem<any> = {
component: 'your-dynamic-component',
config: { title: 'Dynamic title' },
};
}
FAQs
> Core package of Orchestrator library.
The npm package @orchestrator/core receives a total of 2,623 weekly downloads. As such, @orchestrator/core popularity was classified as popular.
We found that @orchestrator/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.