Topic: Installing MDB angular 4 in existing angular-cli project
St Clair Clarke
pro asked 8 years ago
Rafał Rogulski
answered 8 years ago
mdb-angular-pro/
folders img
, scss
and font
to your_project/
- all these folders should be a move to this same place
2. Add external lib to package.json
:
paste this line at the end of dependencies
"@angular/animations": "^4.0.1",
"bootstrap": "^4.0.0-alpha.6",
"chart.js": "^2.5.0",
"classlist.js": "^1.1.20150312",
"easy-pie-chart": "^2.1.7",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"screenfull": "^3.2.0",
"web-animations-js": "^2.2.5"
in terminal go to your project and install package with npm install
3. Edit angular-cli.json:
change styleExt
to scss: "styleExt": "css" -> "styleExt": "scss"
add bootstrap, font-awesome and rename style.css:
this should look like
"styles": [
"../node_modules/bootstrap/scss/bootstrap.scss",
"../node_modules/font-awesome/scss/font-awesome.scss",
"styles.scss"
]
add scripts
"scripts": [
"../node_modules/chart.js/dist/chart.js",
"../node_modules/easy-pie-chart/dist/easypiechart.js",
"../node_modules/screenfull/dist/screenfull.js"
],
4. add imports in your main ts file
import { ..., NO_ERRORS_SCHEMA } from '@angular/core';
import { MDBBootstrapModule } from './typescripts/angular-bootstrap-md/free';
import { MDBBootstrapModulePro } from './typescripts/angular-bootstrap-md/pro';
import { AgmCoreModule } from './typescripts/angular-bootstrap-md/free/angular2-google-maps/ts/core';
imports: [
...,
MDBBootstrapModule.forRoot(),
MDBBootstrapModulePro.forRoot(),
AgmCoreModule.forRoot({
apiKey: 'Google_maps_api_key'
})
],
shemas: [NO_ERRORS_SCHEMA]
Regards
St Clair Clarke
pro answered 8 years ago
Rafał Rogulski
answered 8 years ago
mdb-angular-pro/src/app/
folder is called typescripts
, move this folder to yourProject/src/app/
this should fix this problem.
2. If you will use Google maps component on your page, Yes. If no you can even remove this line and imports to AgmCoreModule.
Regards
alobban@afnww.com
pro answered 8 years ago
alobban@afnww.com
pro answered 8 years ago
Rafał Rogulski
answered 8 years ago
styleExt
to scss in angular-cli.json?
Regards
alobban@afnww.com
pro answered 8 years ago
alobban@afnww.com
pro answered 8 years ago
Rafał Rogulski
answered 8 years ago
St Clair Clarke
pro answered 8 years ago
Rafał Rogulski
answered 8 years ago
Rafał Rogulski
answered 8 years ago
Rafał Rogulski
answered 8 years ago
davram88
pro answered 8 years ago
Rafał Rogulski
answered 8 years ago
skinow
pro answered 8 years ago
Adrian Sawicki
answered 8 years ago
clement.boulevart
pro answered 8 years ago
St Clair Clarke pro commented 8 years ago
Hi Clement, I get similar warnings about circular dependencies. I wish the fellows at MDB would sort it out. Lots of warnings in my console.clement.boulevart pro commented 8 years ago
Thank you very much for your feedback. No worries about that then I guess.
Adrian Sawicki
answered 8 years ago
Bernardao
answered 7 years ago
Bernardao
answered 7 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No