How to load image (and other assets) in Angular an project?

In my project I am using the following syntax in my app.component.html: <img src=”/assets/img/1.jpg” alt=”image”> or <img src=”http://mruanova.com/img/1.jpg” alt=”image”> use [src] as a template expression when you are binding a property using interpolation: <img [src]=”imagePath” /> is the same as: <img src={{imagePath}} /> Source: how to bind img src in angular 2 in ngFor?

PowerShell script add ‘–prod’ argument to build Angular CLI project

Neko Musume’s helpful answer provides a solution to your immediate problem. However, it’s worth taking a step back: To synchronously execute console applications or batch files, call them directly (ng build … or & ng build …), do not use Start-Process – see this answer and this GitHub docs issue detailing appropriate vs. non-appropriate use … Read more

Angular-cli from css to scss

For Angular 6 check the Official documentation Note: For @angular/cli versions older than 6.0.0-beta.6 use ng set in place of ng config. For existing projects In an existing angular-cli project that was set up with the default css styles you will need to do a few things: Change the default style extension to scss Manually … Read more

angular-cli where is webpack.config.js file – new angular6 does not support ng eject

There’s a nice way to eject webpack.config.js from angular-cli. Just run: $ ng eject This will generate webpack.config.js in the root folder of your project, and you’re free to configure it the way you want. The downside of this is that build/start scripts in your package.json will be replaced with the new commands and instead … Read more

Load new modules dynamically in run-time with Angular CLI & Angular 5

I was facing the same problem. As far as I understand it until now: Webpack puts all resources in a bundle and replaces all System.import with __webpack_require__. Therefore, if you want to load a module dynamically at runtime by using SystemJsNgModuleLoader, the loader will search for the module in the bundle. If the module does … Read more

jQuery is not defined in bootstrap-sass

Step One npm install jssha –save [using jssha for this demo] It it is your own custom file place it in the scripts array of angular-cli.json skip this step 1 Step two Add the jssha scripts file in .angular-cli.json file “scripts”: [ “../node_modules/jssha/src/sha.js” ] Step three Adding a var in component to be used as … Read more