在组件中使用styleUrls时Angular-CLI出错

时间:2016-11-21 20:00:49

标签: angular angular-cli

当我在组件中使用styleUrls时,我收到错误Error: Uncaught (in promise): TypeError: Cannot read property 'replace' of undefined。请找下面的代码。当我删除styleUrls数组时,组件加载没有任何错误。

 import { Component, OnInit, AfterViewInit, ViewEncapsulation, OnDestroy } from '@angular/core';
    import { Router, ActivatedRoute, CanDeactivate, RoutesRecognized, NavigationStart } from '@angular/router';
    import { Title } from '@angular/platform-browser';
    import { links } from '../../constants/config';
    import { TestScheduleModel } from '../../models/test-schedule.model';
    import { Observable, Subscription } from 'rxjs/Rx';
    import { Response } from '@angular/http';
    import { UtilityService } from '../../services/utility.service';
    import { TestService } from './test.service';
    import { AuthService } from './../../services/auth.service';
    import { CommonService } from './../../services/common.service';
    import { TestStartedExceptionModal } from './../../models/test-started-exceptions.model';
    import { TimingExceptionsModal } from './../../models/timing-exceptions.model';
    import { LogService } from './../../services/log.service';

    @Component({
        selector: 'schedule-test',
        templateUrl: './schedule-test.component.html',
        styleUrls: [
            "../../../assets/css/bootstrap-editable.css",
            "../../../assets/css/bootstrap-editable-overrides.css",
            "../../../assets/css/bootstrap-datepicker-overrides.css",
            "../../../assets/css/jquery.timepicker.css",
            "./schedule.component.css"
        ],
        encapsulation: ViewEncapsulation.None
    })
    export class ScheduleTestComponent {
    }

0 个答案:

没有答案