2017-03-23 30 views
0

我使用angular4.0。我使用bootstrap3.3.7。使用bootstrap3角

我成功地使用了引導按鈕和網格。 但是,DropDown &日期選擇器不能很好地使用。

安裝包。

角cli.json

"styles": [ 
"../node_modules/bootstrap/dist/css/bootstrap.css", 
"styles.css" 
], 

app.component。 html

{{title}} 

    <div class="row"> 
    <div class="col"> 
    <div ngbDropdown class="d-inline-block"> 
     <button class="btn btn-outline-primary" id="dropdownMenu1" ngbDropdownToggle>Toggle dropdown</button> 
     <div class="dropdown-menu" aria-labelledby="dropdownMenu1"> 
     <button class="dropdown-item">Action - 1</button> 
     <button class="dropdown-item">Another Action</button> 
     <button class="dropdown-item">Something else is here</button> 
     </div> 
    </div> 
    </div> 
    </div> 

app.component.ts

import { Component } from '@angular/core'; 

@Component({ 
    selector: 'app-root', 
    templateUrl: './app.component.html', 
    styleUrls: ['./app.component.css'] 
}) 
export class AppComponent { 
    title = 'app works!'; 
} 

這SRC使得按鈕和下拉。 按鈕成功。 但DropDown失敗。

你知道爲什麼dropDown和datepicker不能使用嗎?

+1

角4.0嗎?哇,這是新的我。 – ZimSystem

+0

大概是因爲自舉沒有'下拉-item'類 – YounesM

回答

0

如果您使用的是ng-bootstrap,您應該知道他們使用的是Bootstrap 4,所以可能會出現一些類錯誤。如果您希望使用Angular 2庫作爲Bootstrap 3,則可以從Valor Software中檢查ng2-bootstrap

+0

感謝您的評論 我更換了包裝 ·[email protected] ·[email protected] ·[email protected] 但情況沒有改變。 –

0

除了什麼阿德南說,「NG2的自舉」更名爲「NGX的自舉」;)要知道在你的package.json