Open antonybudianto opened 8 years ago
how do i use lazy loading in routing [loadChildren]?
@masagatech , please use https://github.com/antonybudianto/angular-webpack-starter if you want lazy loading feature
I am trying to use this. everything works fine. However, it won't be able to 'recompile' automatically if file changes. For example, I change the text in a html file, and it seems that the app catched the changes and recompiled. However, i didn't see any changes on the screen. I had to rebuild it again, and then i could see the changes on the screen. Why? Thanks!
@RaydonZhu , please post them as new issue, and tell more details there, thanks
@antonybudianto I added 'use strict' in the config/webpack/webpack.dev.js to fix it.
Thanks!
Dear Antony, thanks a lot for this kit. As live reload with webpack did not work on my machine (I tried the latest ng-cli beta 21 as a well as another starter kit with webpack), your starter pack rescued me as I wanted to start trying out angular 2 without much hassle. In other words: you saved my day ;-)
@NextLevelNoob , You're welcome 😄
Hi @antonybudianto it's nice to try your angular2-starter and more easily to create new project from that.. without it, I need to prepare the env for maybe 2 hours .. so keep it up and thank you!
Is anyone having some issues with CI? always get this error when I try to run "npm run build" ... /bundle.css : unclosed string
Nice project, however I was not able to get it to work with angular-in-memory-web-api
Hello @antonybudianto, I just extend a little bit your basic structure, so that I can include scss files to the component folder.
I use for it gulp-sass-glob
. So I extend the package.json "gulp-sass-glob": "^1.0.8",
.
Also I put this to the end of the main.scss @import '../../app/**/*';
At last I changed the gulp/task/sass.js file to this:
var gulp = require('gulp');
var sass = require('gulp-sass');
var sassGlob = require('gulp-sass-glob');
var config = require('../config')();
gulp.task('sass', function () {
return gulp.src(config.assetsPath.styles + 'main.scss')
.pipe(sassGlob())
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(config.assetsPath.styles));
});
gulp.task('watch-sass', function () {
gulp.watch(config.src + '**/*.scss', ['sass']);
});
@antonybudianto : Thanks, for this nice working startet set. It was really useful. 👍
A real starter! Thx men :+1:
Great starter! Thanks! It will be updated to Angular 4?
@Emerceen I'll update it soon, I've updated it 👍
@yogsadafal
systemjs.conf.js.txt home.module.ts.txt
Since you're using alert on home component, which is part of home module, you must import the alertmodule on home module
@antonybudianto7 got it working.. thanks for quick reply... i was doing it at app.module level.. had to import in home module.. thought if imported globally will be available to child modules.
AFAIK, only module providers will be available to the non-lazy loaded child modules
With prod NODE_ENV set in my profile, serve-build doesn't work -- only set up to work in the dev env. I added the serve-build gulp task, but I am not sure how to get rid of browser sync. That doesn't make much sense in prod. Otherwise, I found this an excellent project seed.
@antonybudianto I'm getting compile errors for config\env\env.ts when I build this project in Visual Studio. Am I missing something.
1>------ Build started: Project: angular-starter-master-vs2015, Configuration: Debug Any CPU ------ 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(14,29): error TS1136: Build:Property assignment expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(14,30): error TS1109: Build:Expression expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(14,65): error TS1109: Build:Expression expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(14,66): error TS1109: Build:Expression expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(15,6): error TS1110: Build:Type expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(15,12): error TS1109: Build:Expression expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(15,13): error TS1109: Build:Expression expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(15,16): error TS1110: Build:Type expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(15,56): error TS1109: Build:Expression expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(15,57): error TS1109: Build:Expression expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(15,59): error TS1110: Build:Type expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(15,61): error TS1109: Build:Expression expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(15,65): error TS1109: Build:Expression expected. 1>C:\Users\sunkum\Desktop\angular-starter-master-vs2015\angular-starter-master-vs2015\config\env\env.ts(16,1): error TS1109: Build:Expression expected. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
And getting Console log when I run angular starter project from Visual Studio 2015
index.html:37 Error: Unexpected token < Evaluating http://localhost:8048/src/src/tmp/app/main.js Loading app/main.js at eval (<anonymous>) at Re (system.js:4) at system.js:4 at j (system.js:4) at O (system.js:4) at k (system.js:4) at system.js:4 at ZoneDelegate.invoke (zone.js:392) at Zone.run (zone.js:142) at zone.js:873
Hi everyone ✋ I would like to know who are using angular-starter and how you use it.
Please share your experiences and usage below!
Thank you ❤️