
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
An Angular directive used the same way as [@NgSwitch](https://angular.io/api/common/NgSwitch) except that it only renders the first truthy directive in the group :
An Angular directive used the same way as @NgSwitch except that it only renders the first truthy directive in the group :
<div ngAltGroup>
<span *ngAlt="false">A</span>
<span *ngAlt="true">B</span>
<span *ngAlt="true">C</span>
</div>
This will render :
<div>
<span>B</span>
</div>
Exemple with form errors:
<mat-input-container>
<input matInput formControlName="password">
<mat-error ngAltGroup>
<span *ngAlt="form.controls.email.hasError('required')">Must not be empty</span>
<span *ngAlt="form.controls.email.hasError('minLength')" translate>Must be at least 8 chars long</span>
<span *ngAlt="form.controls.email.hasError('invalid')" translate>Must be contain symbols, digits and mixed upper and lower cased letters</span>
</mat-error>
</mat-input-container>
This will render the first truthy error only in order of appearance.
npm install --save ng-alt
# or
yarn add ng-alt
Import the module in any Angular module you want to use the directive :
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NgAltModule } from 'ng-alt';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
NgAltModule, // <--- add the module here
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Use it as above :
[ngAltGroup]
directive.[ngAlt]
directive to every element to be conditionally rendered (order matters).FAQs
An Angular directive used the same way as [@NgSwitch](https://angular.io/api/common/NgSwitch) except that it only renders the first truthy directive in the group :
The npm package ng-alt receives a total of 1 weekly downloads. As such, ng-alt popularity was classified as not popular.
We found that ng-alt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.