angular-cli

How to get one file as output of angular cli

二次信任 提交于 2020-01-10 07:54:11
问题 I'm working on ng2 application and I use @angular/cli to build it. As output it emits several js files like .inline.js , .vendor.js etc. The question is -- how to set up angular-cli to emit only one file as a result, i.e. bundle vendor.js , inline.js etc. into one big file? I understand that it could be done by using additional bundler but it would be nice to achieve it via ng-cli PS I don't use lazy loading in this app and definitely won't. PPS Just concat files afterwards is not an option

angular cli exclude files/directory for `ng test --code-coverage`

跟風遠走 提交于 2020-01-09 19:47:08
问题 I am running the following command to unit test and generate code code coverage report. ng test --code-coverage It is working fine and writing code coverage report in coverage folder. In this I got all files and directory coverage report But I want to exclude specific files/directory let say src/app/quote/services/generated . How to do that? 回答1: Updated September 2019 On angular cli 6, angular-cli.json has been renamed to angular.json which contains the configuration. In angular.json ,

Angular CLI ng new error

假装没事ソ 提交于 2020-01-09 11:48:50
问题 I've installed node from https://nodejs.org/en/download and then I installed angular CLI via NPM using npm install -g @angular/cli After it's done, I then try to create a new angular project ng new new-project And I get the following error Error: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable. You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable. I've tried

angular-cli: Conditional Imports using an environment variable

只谈情不闲聊 提交于 2020-01-09 10:41:08
问题 Is there a way to conditionally change imports based on an environment variable in angular-cli@1.0.0-beta.16? I'm trying to do it in a way that doesn't require code changes in how services are imported in client code, but when needed I can specify a build flag to swap in mock services. There is a pattern I tried using from this post: File structure: MyService MyServiceMock.ts MyServiceReal.ts index.ts And in your index.ts, you can have the following: import { environment} from '..

How to iterate using ngFor loop Map containing key as string and values as map iteration

江枫思渺然 提交于 2020-01-09 06:06:29
问题 I am new to angular 5 and trying to iterate the map containing another map in typescript. How to iterate below this kind of map in angular below is code for component: import { Component, OnInit} from '@angular/core'; @Component({ selector: 'app-map', templateUrl: './map.component.html', styleUrls: ['./map.component.css'] }) export class MapComponent implements OnInit { map = new Map<String, Map<String,String>>(); map1 = new Map<String, String>(); constructor() { } ngOnInit() { this.map1.set(

How to iterate using ngFor loop Map containing key as string and values as map iteration

我是研究僧i 提交于 2020-01-09 06:06:10
问题 I am new to angular 5 and trying to iterate the map containing another map in typescript. How to iterate below this kind of map in angular below is code for component: import { Component, OnInit} from '@angular/core'; @Component({ selector: 'app-map', templateUrl: './map.component.html', styleUrls: ['./map.component.css'] }) export class MapComponent implements OnInit { map = new Map<String, Map<String,String>>(); map1 = new Map<String, String>(); constructor() { } ngOnInit() { this.map1.set(

How to iterate using ngFor loop Map containing key as string and values as map iteration

醉酒当歌 提交于 2020-01-09 06:06:05
问题 I am new to angular 5 and trying to iterate the map containing another map in typescript. How to iterate below this kind of map in angular below is code for component: import { Component, OnInit} from '@angular/core'; @Component({ selector: 'app-map', templateUrl: './map.component.html', styleUrls: ['./map.component.css'] }) export class MapComponent implements OnInit { map = new Map<String, Map<String,String>>(); map1 = new Map<String, String>(); constructor() { } ngOnInit() { this.map1.set(

Error when interconnecting ipcRenderer and ipcMain in electron

北战南征 提交于 2020-01-07 04:22:14
问题 I have configured cli angular in electron, and I have a link where it execute a function that intercomunicate ipcRenderer and ipcMain: html: <a (click)="check()"> click </a> component: constructor(private _e: ElectronService) { } check () { this._e.ipcRenderer.send ('conn', 'round'); this._e.ipcRenderer.on ('conn-st', (event, args) => { console.log (args); }); } main.js (electron): ipcMain.on ('conn', function (event, args) { event.sender.send ('conn-st', 'trip'); }); The problem is that when

Angular CLI with Spring Boot

我怕爱的太早我们不能终老 提交于 2020-01-07 03:11:08
问题 I have 2 projects. An Angular2 app which I build with Angular-cli and a Spring Boot app which will only serve the Angular2 app. I build the Angular2 app with ng build which generates a dist folder. I then put the content of the dist folder in the Spring Boot app inside src/main/resources/static . My spring boot app has two files. The Spring boot application class : @SpringBootApplication public class SpringBoot extends SpringBootServletInitializer { @Override protected

Refresh dist directory when uploading new files

╄→гoц情女王★ 提交于 2020-01-06 17:58:37
问题 I'm actually developping an application using Angular2 and Node.js. I started the Angular2 part with Angular-cli. I have an issue concerning file upload. In the application, I can create Albums. In the Album form, there is a file input. In the backend, I store files, actually images, in a files directory in my assets. The problem is, when I try to display this images, they don't display. I need to re-run "ng build" to see them. I assume this is due to the fact this newly uploaded files are