在严格模式下,不允许将Angular NG6 IE分配给只读属性

时间:2017-01-24 00:39:39

标签: javascript angularjs-directive angular-ui-router frontend

View IE console Error

在IE和Mac Safari和iOS设备中不断出现此错误。

在pageheader中它只显示 {{$ ctrl.title}} 而不是值,对此有何看法?

Games.js

import angular from 'angular';
import uiRouter from 'angular-ui-router';
import liveGamesViewComponent from './liveGamesView.component';

let liveGamesViewModule = angular.module('liveGamesView', [
    uiRouter
])
.component('liveGamesView', liveGamesViewComponent)
.config(($stateProvider) => {
    "ngInject";
    $stateProvider
        .state('livegames', {
            url: '/livegames',
            component: 'liveGamesView'
        });
})
.name;
export default liveGamesViewModule;

Games.html

<header>
    <page-header title="Games" bg-class="games"></page-header>
</header>
<main class="livegames">
</main>

PageHeader.component.js

import template from './pageHeader.html';
import controller from './pageHeader.controller';
import './pageHeader.less';
let pageHeaderComponent = {
    restrict: 'E',
    bindings: {
        title: '@',
        bgClass: '@'
    },
    template,
    controller
};
export default pageHeaderComponent;

Pageheader.html

<div class="page-header {{ $ctrl.bgClass }}">
    <div class="bg-mask"></div>
    <div class="page-title">
        <h1>{{ $ctrl.title }}</h1>
    </div>
</div>

Pageheader.js

import angular from 'angular';
import uiRouter from 'angular-ui-router';
import pageHeaderComponent from './pageHeader.component';

let pageHeaderModule = angular.module('PageHeader', [
    uiRouter
])
.component('nblPageHeader', pageHeaderComponent)
.name;

export default pageHeaderModule;

0 个答案:

没有答案