
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
angular-x-tabs
Advanced tools
npm install angular-x-tabs
import { TabsModule } from 'angular-4-tabs';
//...
@NgModule({
imports: [
BrowserModule,
FormsModule,
TabsModule // <---- HERE
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
HTML
<h1>Vertical</h1>
<ngx-tabs actionLabel="create" class="vertical">
<ngx-panel *ngFor="let d of data" [title]="d.title" [unsaved]="d.unsaved">
<p>{{ d.content }}</p>
</ngx-panel>
</ngx-tabs>
<h2>Horizontal</h2>
<h3>With Action Button</h3>
<ngx-tabs>
<ngx-action (click)="addData($event)">Add</ngx-action>
<ngx-action (click)="saveData($event)">Save All</ngx-action>
<ngx-panel *ngFor="let d of data" [title]="d.title" [unsaved]="d.unsaved">
<p>{{ d.content }}</p>
</ngx-panel>
</ngx-tabs>
<h3>Without Action Button</h3>
<ngx-tabs>
<ngx-panel *ngFor="let d of data" [title]="d.title" [unsaved]="d.unsaved">
<textarea [(ngModel)]="d.content" (input)="d.unsaved = true"></textarea>
</ngx-panel>
</ngx-tabs>
TS
public data = [
{
title: Math.random(),
content: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.',
unsaved: false
},
{
title: Math.random().toFixed(3),
content: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.',
unsaved: false
},
{
title: Math.random().toFixed(3),
content: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.',
unsaved: false
}
];
public addData() {
this.data.push({
title: 'new item',
content: 'content',
unsaved: true
});
}
public saveData() {
alert('Saved !');
}
FAQs
Simple Angular 2+ tabs module
We found that angular-x-tabs 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 Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.