Saturday, March 25, 2017

A seed for Angular 4!

A tedious thing about Angular is that whenever you really need to make a sweeping change that entails a major migration such as systemjs.config.js to Webpack (seen as a better dependency management tool) instead of trying to massage that into your existing project, you'll find it easier to just get a seed project for the new approach and migrate everything else in your application into it. With that in mind, I wanted to get the application I detail here, here, and here into an Angular 4 shape now that Angular 4 has been out for two days. I found a seed at https://github.com/mgechev/angular-seed and after putting the files in a folder I made my way into the root from PowerShell's prompt and I typed "npm install" to hydrate the "node_modules" folder followed by "npm start" to run the app at http://localhost:5555/ finally followed up by Ctrl-C to stop running the app. Fine! Now, to add my code... At index.html in the client folder, line 17 reading...

<sd-app>Loading...</sd-app>

 
 

...became...

<entry-point>Loading...</entry-point>

 
 

...and in the app folder in the client folder I replaced the main.ts file with the one I had. The folders in my app folder I just copied and pasted into the app folder. I then ran the app and it worked. Yay! It's not making .js files side by side with the .ts files. I don't know why yet. Whatever.

No comments:

Post a Comment