Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@cerebral/angular
Advanced tools
Angular view for Cerebral.
npm install @cerebral/angular @angular/core @angular/platform-browser babel-plugin-transform-decorators-legacy
The Cerebral service exposes the Cerebral controller to your application.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { provide } from 'cerebral'
import { ControllerService } from '@cerebral/angular'
import { AppComponent } from './app.component.ts'
import { SomeAngularService } from './SomeAngularService'
// Create a factory to instantiate Cerebral. It can receive
// dependencies which you can "provide" to Cerebral to be used
// within signals
export function configureController(someAngularService : SomeAngularService) {
return new ControllerService({
// We use the "provide" function to an angular service to the signals
// of Cerebral
providers: [
provide('someAngularService', someAngularService)
]
})
})
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ],
providers: [
{
provide: ControllerService,
useFactory: configureController,
deps: [SomeAngularService]
},
]
})
export class AppModule {}
The connect decorator connects state and signals to your components.
import { Component, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'
import { signal, state } from 'cerebral/tags'
import { connect, ControllerService, CerebralComponent } from '@cerebral/angular'
@Component({
selector: 'app-component',
template: `
<div (click)="onClick()">{{foo}}</div>
`,
// Change detection needs to be set to "OnPush"
changeDetection: ChangeDetectionStrategy.OnPush
})
@connect({
// For AOT to work you will have to use the array version of template
// tags
myName: state(['foo']),
onClick: signal(['clicked'])
})
export class AppComponent extends CerebralComponent {
// You have to inject "ChangeDetectionRef" and "ControllerService" and pass
// them to parent for connect to do its work
constructor(cdr: ChangeDetectorRef, controller: ControllerService) {
super(cdr, controller)
controller.getSignal('onClick')()
}
}
FAQs
Angular view for Cerebral
The npm package @cerebral/angular receives a total of 90 weekly downloads. As such, @cerebral/angular popularity was classified as not popular.
We found that @cerebral/angular demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.