• Najnowsze pytania
  • Bez odpowiedzi
  • Zadaj pytanie
  • Kategorie
  • Tagi
  • Zdobyte punkty
  • Ekipa ninja
  • IRC
  • FAQ
  • Regulamin
  • Książki warte uwagi

Instalacja bootstrapa w aplikacji angular.

Object Storage Arubacloud
0 głosów
530 wizyt
pytanie zadane 28 lipca 2018 w Inne języki przez SandraS Obywatel (1,400 p.)

Próbuję dołaczyć bootstrapa i kicha.
Robiłam z tutorialami i cały czas coś nie działa.
instalowałam przez npm install.
Mój package.json:
 

  "dependencies": {
    "@angular/animations": "^5.2.11",
    "@angular/common": "^5.2.11",
    "@angular/compiler": "^5.2.11",
    "@angular/core": "^5.2.11",
    "@angular/forms": "^5.2.11",
    "@angular/http": "^5.2.11",
    "@angular/platform-browser": "^5.2.11",
    "@angular/platform-browser-dynamic": "^5.2.11",
    "@angular/router": "^5.2.11",
    "@ng-bootstrap/ng-bootstrap": "2.0.0",
    "@ngrx/core": "^1.2.0",
    "@ngrx/effects": "^5.2.0",
    "@ngrx/store": "^4.1.1",
    "angular-2-local-storage": "^1.0.2",
    "angular-async-local-storage": "^3.1.4",
    "angular2-uuid": "^1.1.1",
    "bootstrap": "^3.3.7",
    "core-js": "^2.5.7",
    "jquery": "^1.9.1",
    "ngx-bootstrap": "^3.0.1",
    "react-redux": "^5.0.7",
    "redux": "^3.7.2",
    "rxjs": "^5.5.11",
    "zone.js": "^0.8.26"
  },

a błąd jaki wywala to:

ERROR in node_modules/@ng-bootstrap/ng-bootstrap/buttons/radio.d.ts(58,96): error TS2315: Type 'ElementRef' is not generic.
node_modules/@ng-bootstrap/ng-bootstrap/datepicker/datepicker-input.d.ts(121,67): error TS2315: Type 'ElementRef' is not generic.
node_modules/@ng-bootstrap/ng-bootstrap/datepicker/datepicker.d.ts(115,208): error TS2315: Type 'ElementRef' is not generic.
node_modules/@ng-bootstrap/ng-bootstrap/dropdown/dropdown.d.ts(12,45): error TS2315: Type 'ElementRef' is not generic.
node_modules/@ng-bootstrap/ng-bootstrap/dropdown/dropdown.d.ts(29,45): error TS2315: Type 'ElementRef' is not generic.
node_modules/@ng-bootstrap/ng-bootstrap/dropdown/dropdown.d.ts(37,44): error TS2315: Type 'ElementRef' is not generic.
node_modules/@ng-bootstrap/ng-bootstrap/modal/modal-window.d.ts(14,40): error TS2315: Type 'ElementRef' is not generic.
node_modules/@ng-bootstrap/ng-bootstrap/popover/popover.d.ts(11,27): error TS2315: Type 'ElementRef' is not generic.
node_modules/@ng-bootstrap/ng-bootstrap/popover/popover.d.ts(70,30): error TS2315: Type 'ElementRef' is not generic.
node_modules/@ng-bootstrap/ng-bootstrap/tooltip/tooltip.d.ts(9,27): error TS2315: Type 'ElementRef' is not generic.
node_modules/@ng-bootstrap/ng-bootstrap/tooltip/tooltip.d.ts(54,30): error TS2315: Type 'ElementRef' is not generic.
node_modules/@ng-bootstrap/ng-bootstrap/typeahead/typeahead.d.ts(94,30): error TS2315: Type 'ElementRef' is not generic.

Wg. stack overflow przy tym problemie trzeba zejść do @ng-bootstrap 2.00. Zeszłam, zrobiłam npm install i dostałam:
 

npm WARN @ngrx/effects@5.2.0 requires a peer of @ngrx/store@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@3.2.2 requires a peer of @angular/compiler@^2.3.1 || >=4.0.0-beta <5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@3.2.2 requires a peer of @angular/core@^2.3.1 || >=4.0.0-beta <5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-bootstrap@3.0.1 requires a peer of @angular/common@>=6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-bootstrap@3.0.1 requires a peer of @angular/core@>=6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-redux@5.0.7 requires a peer of react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN redux-devtools@3.4.1 requires a peer of react@^0.14.9 || ^15.3.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ng-bootstrap/ng-bootstrap@2.0.0 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ng-bootstrap/ng-bootstrap@2.0.0 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ng-bootstrap/ng-bootstrap@2.0.0 requires a peer of @angular/forms@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ng-bootstrap/ng-bootstrap@2.0.0 requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.

Podniosłam Angular Cli do 6.0.0 i teraz to nawet apki nie mogę odpalić, wyskakuje:
 

The Angular CLI configuration format has been changed, and your existing configuration can
be updated automatically by running the following command:

  ng update @angular/cli

robię to ng update @angular/cli i wyskakuje jakiś długi error, zaczynający się od: ,,Error compiling schema, function code: var customRule0 = customRules[0]; var validate = async function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict';  var vErrors = null;  var errors = 0;      if (rootData === undefined) rootData = data;  if ((data && typeof data === "object" && !Array.isArray(data))) {   if (data.force === undefined) data.force =  false ;   if (data.all === undefined) data.all =  false............(...)

Pomóżcie!

 

2 odpowiedzi

0 głosów
odpowiedź 28 lipca 2018 przez Tomek Sochacki Ekspert (227,510 p.)
przywrócone 28 lipca 2018 przez Tomek Sochacki

A dodałaś w pliku .angular-cli.json:

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

czyli style bootstrapa do ogólno dostępnych styli?

 

0 głosów
odpowiedź 28 lipca 2018 przez plucins Stary wyjadacz (11,110 p.)

jak zainstalujesz bootstrapa to w pliku style.css dodaj sobie 

@import '~bootstrap/dist/css/bootstrap.min.css';

dodatkowo używasz dwóch bibliotek, które robią to samo 

"ngx-bootstrap": "^3.0.1",
"bootstrap": "^3.3.7",

zdecyduj się na jedną

komentarz 28 lipca 2018 przez SandraS Obywatel (1,400 p.)
Mam tę linijkę :(

Podobne pytania

0 głosów
1 odpowiedź 250 wizyt
pytanie zadane 28 lipca 2018 w C i C++ przez SandraS Obywatel (1,400 p.)
+1 głos
1 odpowiedź 255 wizyt
0 głosów
1 odpowiedź 655 wizyt
pytanie zadane 19 listopada 2015 w Inne języki przez Michał_Warmuz Mądrala (5,830 p.)

92,572 zapytań

141,422 odpowiedzi

319,643 komentarzy

61,959 pasjonatów

Motyw:

Akcja Pajacyk

Pajacyk od wielu lat dożywia dzieci. Pomóż klikając w zielony brzuszek na stronie. Dziękujemy! ♡

Oto polecana książka warta uwagi.
Pełną listę książek znajdziesz tutaj.

Akademia Sekuraka

Kolejna edycja największej imprezy hakerskiej w Polsce, czyli Mega Sekurak Hacking Party odbędzie się już 20 maja 2024r. Z tej okazji mamy dla Was kod: pasjamshp - jeżeli wpiszecie go w koszyku, to wówczas otrzymacie 40% zniżki na bilet w wersji standard!

Więcej informacji na temat imprezy znajdziecie tutaj. Dziękujemy ekipie Sekuraka za taką fajną zniżkę dla wszystkich Pasjonatów!

Akademia Sekuraka

Niedawno wystartował dodruk tej świetnej, rozchwytywanej książki (około 940 stron). Mamy dla Was kod: pasja (wpiszcie go w koszyku), dzięki któremu otrzymujemy 10% zniżki - dziękujemy zaprzyjaźnionej ekipie Sekuraka za taki bonus dla Pasjonatów! Książka to pierwszy tom z serii o ITsec, który łagodnie wprowadzi w świat bezpieczeństwa IT każdą osobę - warto, polecamy!

...