0

I am trying to add a plus button next to a tab and on click of which I want to add one more tab. Here is my code(see the mentioned plunker).

Currently it does not seem working. Can you please let me know how to add a tab dynamically on click of a button in angular 2.

@Component({
  selector: 'my-app',
  template: `
    <tabs>
      <tab [tabTitle]="'Tab 1'">Tab 1 Content</tab>
    </tabs>
  `
})
class App {
  constructor() {
    this.name = 'Angular2'
  }
}

Plunker: https://plnkr.co/edit/O5EZaw5Nn36QP3XEJM0R?p=preview

eko
  • 39,722
  • 10
  • 72
  • 98
test
  • 417
  • 4
  • 9
  • 19
  • https://plnkr.co/edit/O5EZaw5Nn36QP3XEJM0R?p=preview. Sorry the plunker was missed. – test Mar 06 '17 at 16:25
  • Have you checked http://stackoverflow.com/questions/36325212/angular-2-dynamic-tabs-with-user-click-chosen-components/36325468#36325468 ? – eko Mar 06 '17 at 16:49
  • Yes, the plunker does not seem working correct in this example. – test Mar 06 '17 at 17:05
  • In the plunker, nothing happens on click of a component. No tab has been added, – test Mar 06 '17 at 17:33

0 Answers0