ng-bootstrap - Typeahead dropdown width

前端 未结 7 825
我在风中等你
我在风中等你 2021-01-18 06:34

I started using the ng-bootstrap Typeahead component and I\'m pretty happy with that.

One thing I would like to achieve is to get the dropdown items to have the same

7条回答
  •  迷失自我
    2021-01-18 07:06

    Add encapsulation: ViewEncapsulation.None to the component

    import {Component, ViewEncapsulation} from '@angular/core';
    
    @Component({
      selector: 'ngbd-typeahead-template',
      templateUrl: 'src/typeahead-template.html',
      styleUrls: ['src/typeahead-template.css'],
      encapsulation: ViewEncapsulation.None
    })
    

    See updated plunker

    Without ViewEncapsulation.None, the styles applied in this component will only effect this component and not any other component on this page.

    Read this for more information

提交回复
热议问题