New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-x-tabs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-x-tabs

Simple Angular 2+ tabs module

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

DEMO

View on stackblitz

Install

npm install angular-x-tabs

Usage

import { TabsModule } from 'angular-4-tabs';

//...

@NgModule({
  imports:      [
      BrowserModule,
      FormsModule,
      TabsModule // <---- HERE
  ],
  declarations: [ AppComponent ],
  bootstrap:    [ AppComponent ]
})

Example

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 !');
  }

API

ACTION

TABS

PANEL

  • [title] : Text used for the tab title
  • [unsaved] : Boolean used to show a star after the title

Keywords

FAQs

Package last updated on 03 Jul 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc