question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

css not working with angular-cli

See original GitHub issue

I tried to test ngx-datatable on my angular-cli project, but the css is not applied and i got a result like this

capture d ecran 2016-12-19 a 22 00 27

I imported NgxDatatableModule in my app.module and linked css as in the documentation in my index.html < link rel="stylesheet" type="text/css" href="./release/datatable.css" /> < link rel="stylesheet" type="text/css" href="./release/material.css" /> (I added a space here between < and link due to github injection security but it’s not present in my code)

And my html look like this <ngx-datatable class='material' [rows]='rows' [columnMode]="'standard'" [headerHeight]="50" [footerHeight]="50" [rowHeight]="50" [scrollbarV]="true" (page)="onPage($event)"> <ngx-datatable-column name="Name" width="200"> <template let-value="value" ngx-datatable-cell-template> <strong>a</strong> </template> </ngx-datatable-column> <ngx-datatable-column name="Gender" width="300"> <template let-row="row" let-value="value" ngx-datatable-cell-template> <i [innerHTML]="row['name']"></i> and <i>b</i> </template> </ngx-datatable-column> <ngx-datatable-column name="Age" width="80"> </ngx-datatable-column> </ngx-datatable>

Also my package.json dependencies "dependencies": { "@angular/common": "2.3.1", "@angular/compiler": "2.3.1", "@angular/core": "2.3.1", "@angular/forms": "2.3.1", "@angular/http": "2.3.1", "@angular/platform-browser": "2.3.1", "@angular/platform-browser-dynamic": "2.3.1", "@angular/router": "3.3.1", "@swimlane/ngx-datatable": "4.0.0", "angular2-cookie": "1.2.5", "angular2-toaster": "1.1.0", "core-js": "^2.4.1", "js-sha256": "0.3.2", "ng2-bootstrap": "1.1.16", "rxjs": "5.0.1", "ts-helpers": "^1.1.1", "zone.js": "^0.6.23" }, "devDependencies": { "@angular/compiler-cli": "2.3.1", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "angular-cli": "1.0.0-beta.21", "codelyzer": "~2.0.0-beta.1", "jasmine-core": "2.5.2", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-remap-istanbul": "^0.2.1", "protractor": "4.0.9", "ts-node": "1.2.1", "tslint": "^4.0.2", "typescript": "~2.0.3", "webdriver-manager": "10.2.5" }

So i don’t know if it’s an error in my implementation, if the doc is incorrect or if it’s an issue with the ngx-datatable module or another module…

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
PEsteves8commented, Dec 20, 2016

Got the same problem. Here’s a print screen:

tableexample

2reactions
fabiobernardocommented, Apr 21, 2021

Eu Resolvi assim (I resolved in Angular11 themes) Angular 11 no angular.json

"projects": {
  "admin": {
    "architect": {
      "build": {
        "options": {
             styles": [
                  "./node_modules/@swimlane/ngx-datatable/index.css",
                  "./node_modules/@swimlane/ngx-datatable/themes/material.scss",
                  "./node_modules/@swimlane/ngx-datatable/assets/icons.css" 
            ]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular-cli build generated CSS not working - Stack Overflow
I have an angular-cli app and using webpack. When I try to run it the component specific css doesn't work. styles.css
Read more >
CSS not working when bundled · Issue #7593 - GitHub
I just tried with @angular/cli@1.4.0-rc.2 , but unfortunately, the behavior is exactly the same.
Read more >
Building StyleSheets Using the Angular CLI - Pluralsight
This command will create a new Angular app within your current directory that is named testing-css . In the process of creating your...
Read more >
This is how angular-cli/webpack delivers your CSS styles to ...
This is how angular-cli/webpack delivers your CSS styles to the client. Have you ever wondered how is it possible to import CSS into...
Read more >
Component styles - Angular
The Angular CLI command ng generate component defines an empty styles array when you create the component with the --inline-style flag. content_copy ng...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found