我一直在使用Angular 2和Firebase创建Web应用程序,我想启用生产模式.
main.ts
if (environment.production) {
enableProdMode();
}
Run Code Online (Sandbox Code Playgroud)
environment.ts
export const environment = {
production: true
};
Run Code Online (Sandbox Code Playgroud)
environment.prod.ts
export const environment = {
production: true
};
Run Code Online (Sandbox Code Playgroud)
然后我尝试了build -prod; 服务,但仍然没有工作.
提前致谢.
我想在angular2应用程序中插入实时图表,我正在使用angular2-highcharts.
npm install angular2-highcharts --save
Run Code Online (Sandbox Code Playgroud)
app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'app works!';
options: Object;
constructor() {
this.options = {
title : { text : 'simple chart' },
series: [{
data: [29.9, 71.5, 106.4, 129.2],
}]
};
}
}
Run Code Online (Sandbox Code Playgroud)
app.component.html
<chart [options]="options"></chart>
Run Code Online (Sandbox Code Playgroud)
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } …Run Code Online (Sandbox Code Playgroud)