fix(aio): do not display a Toc initially

Previously the `hasToc` was initialised to true, which caused a flash of
unwanted "Contents" [sic] even if the page was not going to need a ToC.

Closes #16597
This commit is contained in:
Peter Bacon Darwin 2017-05-06 09:30:18 +01:00 committed by Pete Bacon Darwin
parent 799be9c98a
commit b9ed97c0d9
2 changed files with 5 additions and 1 deletions

View File

@ -55,6 +55,10 @@ describe('TocComponent', () => {
expect(tocComponent.isEmbedded).toEqual(true);
});
it('should not display a ToC initially', () => {
expect(tocComponent.hasToc).toBe(false);
});
it('should not display anything when no TocItems', () => {
tocService.tocList.next([]);
fixture.detectChanges();

View File

@ -12,7 +12,7 @@ import { TocItem, TocService } from 'app/shared/toc.service';
export class TocComponent implements OnInit, OnDestroy {
hasSecondary = false;
hasToc = true;
hasToc = false;
isClosed = true;
isEmbedded = false;
private primaryMax = 4;