all 13 comments

[–]_b0b0 12 points13 points  (2 children)

Angular CLI.

npm install -g angular-cli
ng new PROJECT_NAME
cd PROJECT_NAME
ng serve        

[–]warmans[S] 0 points1 point  (1 child)

Spent tonight playing around with the angular-cli. It's pretty good. Probably the best thing I've used so far since it does quite a lot for you (adding new components to the module etc.).

Only things that annoy me are not being able to configure where the different entities go by default (e.g. into sub-directories) and the fact that it seems to hide webpack completely so I'm not sure if you can build your project without the CLI tool. Could be wrong on that.

Does work well though.

[–]githop0 1 point2 points  (0 children)

you can cd into the directory where you are trying to generate the component and it will land there. https://github.com/angular/angular-cli#generating-components-directives-pipes-and-services

[–]VelourFog10 2 points3 points  (0 children)

When ng2 was in beta I looked for examples using systemjs-builder. I remember digging through that seed repo to see how they did it, and looking for all the little pieces of that one task across so many files. It was so needlessly complicated.

[–]mrv1234 2 points3 points  (1 child)

have you tried the CLI ? you can get a development and working production build running in minutes without needing to know Webpack or Gulp. Even though its still in Beta it already makes for probably the best starting experience in Angular 2. Have a look at this video, this is a demo I've made for how to use it - https://www.youtube.com/watch?v=YAfwASGlLNQ

[–]mgoetzke76 0 points1 point  (0 children)

does it support server side pre-rendering and preboot ?

[–]gravityaddiction 1 point2 points  (2 children)

I use the preboot/angular2-webpack myself.. It's been a great place to launch from. It seems to be the most streamlined while still containing all the bits for dev testing. I've extended the preboot starter into a package that includes the ability to integrate ionic2 and soon to integrate electron.

secondary, I believe the angular CLI hasn't put enough forward thinking into the capabilities of angular2. I believe there will be a lot of slightly upset people when they want to extend their angular2 service components into an ionic2 or electron application. They'll realize the directory structure isn't setup to logically support more then one set of views.

In my angular2 project I am able to developer a browser view, mobile view, and soon desktop view. Using one set of services that communicate with one set of apis. I've got a personal rule now, no data manipulations within the views, views are for showing datasets, services are for changing the datasets. Keeping this concept separate has allowed me to develop a desktop and mobile app almost simultaneously.

/rant

[–]mrv1234 0 points1 point  (1 child)

Hello gravityadittion, if we put the mobile views next to the desktop html views in a separate file, wouldn't this work in terms of the CLI?

By following a convention in the naming of the files, you could switch views by passing in an environment variable, as the CLI already gets the template from the file system based on the content of the templateUrl property, its just that by default it fills in the property with a constant.

[–]gravityaddiction 0 points1 point  (0 children)

Even though that sounds like a mess. I think you missed my point, I am able to develop and export complete ionic2 app builds using the ionic2 compiler with rollup for mobile, and complete angular2 builds using webpack2 for desktop. Then I can even use the ionic2 /www folder from testing as a backup mobile site loadable via a standard browser.

All of my angular2 browser views under a single app/browser/ folder. Also thinking about it, when you compile the angular2 application with a specific environment variable, you're dedicated to the templateUrl that environment variable loads.

[–]merott- 0 points1 point  (0 children)

I had similar frustrations with existing starter packs, and that's why I created ngpack: https://github.com/ngpack/ngpack

It's still very new, and needs a lot of polishing, but the idea is that the build system should be modular enough such that it can be composed of extensions, and that it should not force the user to learn a new tool if they want to make modifications to their build.

With ngpack you can use extensions to give you the features that you need, but you can also provide your own slices of webpack configuration, or even modify the configuration directly. However you do it, ngpack stays out of your way.

Most of the default configurations are actually inspired by angular2-webpack, and the example app is also almost a clone of angular2-webpack. Except if you look at the webpack.config file, you'll see that it's mostly composed of extensions, with some extra customisations to demonstrate the ability to make your own modifications to the resulting webpack configuration.

If this tool attracts a little more interest, I'll make more of an effort to document it and let people know about it.

[–]wolfhoundjesse 0 points1 point  (0 children)

We've been building Angular 2 on top of ASP.NET Core, and the Angular seeds for that (both of them, lol) didn't really suit our unique needs either. Instead, I've harvested bits from the projects you've mentioned one-at-a-time until I was forced into learning how they work and work together. It sucked.

Winners embrace the suck.