|
1 | 1 | import {async, fakeAsync, tick, ComponentFixture, TestBed} from '@angular/core/testing'; |
2 | 2 | import {MdTabGroup, MdTabsModule} from './tabs'; |
3 | | -import {Component} from '@angular/core'; |
| 3 | +import {Component, ViewChild} from '@angular/core'; |
4 | 4 | import {By} from '@angular/platform-browser'; |
5 | 5 | import {Observable} from 'rxjs/Observable'; |
6 | 6 |
|
@@ -271,6 +271,10 @@ describe('MdTabGroup', () => { |
271 | 271 | expect(getSelectedLabel(fixture).textContent).toMatch('Chips'); |
272 | 272 | expect(getSelectedContent(fixture).textContent).toMatch('Salt, vinegar'); |
273 | 273 | }); |
| 274 | + |
| 275 | + it('should support @ViewChild in the tab content', () => { |
| 276 | + expect(fixture.componentInstance.legumes).toBeTruthy(); |
| 277 | + }); |
274 | 278 | }); |
275 | 279 |
|
276 | 280 | /** |
@@ -389,10 +393,12 @@ class AsyncTabsTestApp { |
389 | 393 | <md-tab label="Junk food"> Pizza, fries </md-tab> |
390 | 394 | <md-tab label="Vegetables"> Broccoli, spinach </md-tab> |
391 | 395 | <md-tab [label]="otherLabel"> {{otherContent}} </md-tab> |
| 396 | + <md-tab label="Legumes"> <p #legumes>Peanuts</p> </md-tab> |
392 | 397 | </md-tab-group> |
393 | 398 | ` |
394 | 399 | }) |
395 | 400 | class TabGroupWithSimpleApi { |
396 | 401 | otherLabel = 'Fruit'; |
397 | 402 | otherContent = 'Apples, grapes'; |
| 403 | + @ViewChild('legumes') legumes: any; |
398 | 404 | } |
0 commit comments