I am going to use Sing App - Web & Angular 2.0 Dashboard template for our assignment but this app is not based on Angular CLI project. I have to bring this app on Angular CLI.I have tried some option but not succeeds. Please suggest the best way bring this app over Angular CLI.
1 Answer
UPDATE 08/07/2017: If you are looking how to upgrade angular cli breaking changes when you migrating to a newer version check this answer
- Run
npm uninstall -g angular-clithennpm cache clean - Run
npm install -g angular-climore details here - Backup your
app - Go to your
appfolder - Run
ng init- this command will initialize theangular-cliapp by writing some files in to your existing app. Be careful with overriding the existing files, skip the ones you are not sure, however you always can refer to your backup. - Run
ng new simple-app- this one you will be using as aangular-clisource of truth app. - Compare files produced/required by
angular-cliin yourappwithsimple-appto see if anything gets missed during step 4. - Make sure that all requited
angular-clinpm modules gets installed in to yourapp(comparepackage.jsonfiles) - Run
npm startit might give you an errors you have to fix. You might need to go back to steps 7. and 8. here. If you mess up the packages you might need to removenode_modulesfolder and runnpm install. - You can access your
appat http://localhost:4200
6 Comments
Torreto
Following your step but CLI is hanged after "70% building modules 763/763 modules 0 active"
angularconsulting.au
it might be an issue with some of your
npm packages, check that all your packages are compatiable with your current angular 2.x.x version, also check your typescript version, make sure it is 2.0.10. You might have some of your packages verisons prefixed with ^, so just go to npm_modules and check the pakage.json of a particular package to manually to check it's the exact version. Also you can disable packages manually one-by-one by putting comments in app.module.ts just to find out which is failing during the build.Torreto
Thanks ...Working Now
Pratik Kelwalkar
Hi im trying to do the same but unable to, can u please elaborate on which files to replace and which not to?
Pratik Kelwalkar
@Kuncevic i tried the steps above, but i guess the cli version has changed drastically, could you provide the steps. One way i tried is using all there css and JS from ajax version of Sing App, but not everything works as required. Please do help!
|