Angular-calendar: Can't get styling applied to calendar

Created on 13 Oct 2016  路  9Comments  路  Source: mattlewis92/angular-calendar

This is the closest I can get to applying styling following code in the demo.
screen shot 2016-10-12 at 19 23 09

The only error I'm getting in my browser is

[Error] TypeError: undefined is not an object (evaluating 'window.FontAwesomeCdnConfig.asyncLoading')
    runTask (main.bundle.js:79243)
    invoke (main.bundle.js:79407)

I do not have an entry.ts but I'm using a main.ts inside my src folder. It's contents are

import 'bootstrap/dist/css/bootstrap.css';
import 'font-awesome/css/font-awesome.css';
import 'angular2-calendar/dist/css/angular2-calendar.css';
import 'intl';
import 'intl/locale-data/jsonp/en';
import 'core-js';
import 'zone.js/dist/zone';
import './polyfills.ts';
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { environment } from './environments/environment';
import { AppModule } from './app/';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule);

Most helpful comment

Same thing here. Just added this css file into my angular.json styles section
"styles": [ "styles/index.scss", "./node_modules/angular-calendar/css/angular-calendar.css" ],

All 9 comments

I can't see anything that'd obviously wrong there, I suspect it's probably an issue with your build tool. What are you using? e.g. webpack, system.js etc?

@mattlewis92 I'm using angular-cli which uses webpack as my build tool.

That'd odd, it should just work with the CLI. There's definitely some other config interfering with your app though as from the screenshot you can see the optional bootstrap theme is also being included and it's not referenced in the code snippet you included.

Ah, this is a CLI issue actually, they don't support including stylesheets in typescript config as it's non standard: https://github.com/angular/angular-cli/issues/1459

I think you need to include the stylesheet somewhere in your cli config, there was a PR referenced at the end of that issue that shows how to do it.

i am also facing the same issue.i am not getting any error
screen shot 2016-10-19 at 12 12 24 pm

@kodiraj you're not including the stylesheets into your app. You need this somewhere:

import 'angular2-calendar/dist/css/angular2-calendar.css';

Just include it in angular.json and refresh the application. Because the CLI does not recognize the @import by the browser, it even loads, but the settings does not apply. I am using CLI version 6.0.x

@kodiraj voc锚 n茫o est谩 incluindo as folhas de estilo em seu aplicativo. Voc锚 precisa disso em algum lugar:

import 'angular2-calendar/dist/css/angular2-calendar.css';

I made this configuration in angular.json and it worked

Same thing here. Just added this css file into my angular.json styles section
"styles": [ "styles/index.scss", "./node_modules/angular-calendar/css/angular-calendar.css" ],

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ntsiatinis picture ntsiatinis  路  4Comments

vinay13 picture vinay13  路  3Comments

fmoessle picture fmoessle  路  5Comments

Novabllast picture Novabllast  路  3Comments

chaouiy picture chaouiy  路  3Comments