r/angularjs • • May 25 '16

Some complaints about angular2/angular-cli

https://gist.github.com/NullVoxPopuli/82ee489121fcc21a0e80aaf88559dada
9 Upvotes

29 comments sorted by

View all comments

1

u/uberpwnzorz May 26 '16 edited May 26 '16

Tag bloat with ngDirectives (such as ngFor)

In your example there are inline styles, you should be setting a single class instead and having the logic be in a function, or in a class variable, not inline.

A better example would be:

    <li *ngFor="let item of items; let idx = index"
        [class.selected]="selectedIdx === idx">

angular-cli doesn't actually compile anything when it builds the dist directory.

You can get the build to bundle in dist with the -prod flag.

Ever had import {...} from '../../../../../../../component-name'? being able to say .. from '@appName/component-name' would be much nicer

You can set up your system.config.ts to alias your libs so you don't need all the relative path stuff in every import statement.

Template paths must be absolute (problem when refactoring)

They actually prefer you to not use absolute paths.

docs and recommended examples have multiple classes in a file.

It depends on how many classes you want to export from a file, most of the component classes are going to be single class per file because that's what makes sense. Some of that is probably for single file in the docs for simplicity of showing all of the needed functions on a single page, and not meant for prod.

I agree the addons should be easier to add in, I'm sure someone will add that to the cli soon, remember it's still beta software and community driven.

4

u/DerNalia May 26 '16

You can get the build to bundle in dist with the -prod flag.

Have you seen the dist directory? there are tons of files. Sure, it is 'more' compiled than not at all, but the templates aren't even mixed in there.

You can set up your system.config.ts to alias your libs so you don't need all the relative path stuff in every import statement.

Nope. https://github.com/angular/angular-cli/issues/865 I was just wanting to reference my own app, not libs.

They actually prefer you to not use absolute paths.

hence the ../../../../../../../../../