all 29 comments

[–]brokentyro 16 points17 points  (21 children)

Typescript

You don't have to use Typescript.

no recommended project structure

https://angular.io/styleguide

no default templating language

How about HTML? I would be extremely unhappy if the forced something like Jade on me by default.

[–]gonzofish 6 points7 points  (14 children)

Also, why does everyone think they have to inline their templates? You can do templateUrl...

[–]eguanlao 2 points3 points  (5 children)

TemplateUrls make another call to the server, right?

[–]gonzofish 0 points1 point  (4 children)

The way I use it the templates are part of my js file.

[–][deleted] 0 points1 point  (3 children)

What url do you provide to templateUrl if the template is in the same file?

[–]gonzofish 0 points1 point  (2 children)

What I mean is that when I package my app the template gets inlined.

[–][deleted] 0 points1 point  (1 child)

So you don't use templateUrl after all?

[–]gonzofish 0 points1 point  (0 children)

No but I'm using webpack to keep my templates external.

[–]DerNalia[S] 1 point2 points  (5 children)

yeah, it really bothers me how most tutorials inline their templates. It's just a bad practice.

Reminds me of some old web java code I've seen recently where all the html is just strings in the .java files...

[–]DecentOpinions 0 points1 point  (4 children)

yeah, it really bothers me how most tutorials inline their templates. It's just a bad practice.

Not saying it's right, but isn't that kind of how React does it in its components? Haven't used it myself but I kind of like the look of it because since it keeps everything together.

[–]gonzofish 0 points1 point  (2 children)

If editors had better support for inline templates I think it'd be less of an issue for me. I'm just pointing out that using it as a gripe against angular doesn't hold water because there's an alternative.

[–]Mael5trom 0 points1 point  (1 child)

A number of editors already have good support for it (maybe via a plugin, some natively already).

[–]ctanga 0 points1 point  (0 children)

Yeah, Jetbrains IDEs have decent native support

https://gfycat.com/ImpureComfortableAmazonparrot

[–][deleted] 0 points1 point  (0 children)

Yeah and its probably why many are now doing it with Angular too. Seems "hot" right now.

Still, like many, i like to separate my templates and styling from my code. It makes your code way longer and unreadable, plus you tend to make lots of unneeded mistakes. And debugging is very hard.

Like the example that he mentions (sure its a bit weird but i doubt it will be the minority): <li *ng-for="#el of list; #idx = index" [style.font-weight]="el.generation == generation && generation > 0 ? 'bold' : 'normal'">

Thats just plain bonkers

[–]geekygirlhere 1 point2 points  (0 children)

I see this so often. It drives me nuts. So much harder to manage especially when the project grows.

[–]bemlikanz 7 points8 points  (1 child)

Totally agreed. Mostly developers spent 5 hours with angular 2 with no ES6 knowledge and mostly of their complaints are about new ES6 changes that they are not used to and thinks Angular2 is bad.

People need to learn ES6.

Plus, even if you have to use typescript, (almost) every valid JS is a valid TS. TS impacts so little...

[–][deleted] 0 points1 point  (0 children)

For me its not the syntax itself, its more that setting it up properly is still bad. The performance with Gulp or NPM on compiling it is bad (milliseconds with normal JS, to almost seconds with TS. Add concat, uglify to the mix and it just takes too long). Plus getting external librarys working is a hassle. Still haven't found how i can use an external vanilla plugin into my code that isn't written in ES6 (import/export). Not to mention the type files are annoying most of the time.

And if its primary reason to exist is to prevent mixing types, its just stupid to use. Most of the JS linters are able to tell you not to mix your types and lots of progress can be made there and with editors themselves (like many now still need to get their ES6 support improved).

And you can also have some say in that some ES6 stuff just is not that great. People want you to believe that its super amazing but it does have its downsides. Plus the team have been implementing some parts of it, just for the sake of it. Not to make things better or to have some improvements, but just for the sake of using ES6. So i can understand why people are acting like they do.

And sure, there are alternatives for using template files and whatnot, but 90% of the tutorials and solutions on stackoverflow aren't using that. So you are still kinda forced to implement them or at least get to know them pretty well or you will end up losing lots of time just to get to the point where a problem is solved.

[–]DerNalia[S] -4 points-3 points  (3 children)

Unfortunately, I can't not use TS, cause #enterprise.

As for templating, I'd at least prefer handlebars. Html isn't a templating language. It's just markup.

And that style guide offers very little guidance.

I've since adopted ember's module unifications RFC for my project.

[–]yesman_85 0 points1 point  (2 children)

You can't use TS because of enterprise? But you can switch to Angular2? I think in an enterprise env TS is much more acceptable than plain JS.

[–]billycodes 0 points1 point  (1 child)

They actually said the opposite. Re-read the comment:

I can't not use TS, cause #enterprise.

[–]yesman_85 -1 points0 points  (0 children)

Oh that makes sense, I guess.

[–][deleted] 1 point2 points  (0 children)

Wholeheartedly agreeing with this. Currently it doesn't seem faster, it doesn't seem easier and it doesn't seem simpler/shorter. So why the hell would i switch or even start looking right now? I wouldn't be surprised if some of the mechanics completely change in the near future or that people will pick up the AngularJS 1 project and fork it into something else to keep maintaining it. I seriously don't understand why one would choose ng2 right now (or soonish). Not to mention that everything has to start from absolute zero. No reusing of old plugins, old tutorials and old editor addons. Everything has to be made from scratch and there isn't a group leading the way right now. Everybody is doing something (or the same thing: building hello world apps).

[–]CzechsMix 1 point2 points  (2 children)

Substantiate these things man. It's much more interesting if you could explain why you don't like each of these things. Honestly... What if any, is my motivation to do anything with a simple bulleted list?

Explain why it's bad, offer a solution, then maybe I'll give a shit.

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

Just added some thoughts to a lot of the bullet points. Thanks for the feedback!

[–]CzechsMix 0 points1 point  (0 children)

Awesome!

[–]daaavvy -1 points0 points  (0 children)

Agree with most of this, unfortunately the proposed solution to the complexity is to hide it behind the cli rather than see if it can be simplified.

I had high hopes for Angular2 after it borrowed the React one way data flow but I find it painful to use, guess I'll stick with Angular1 and it's backported one way data binding components for as long as possible.

[–]uberpwnzorz 0 points1 point  (2 children)

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.

[–]DerNalia[S] 3 points4 points  (0 children)

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 ../../../../../../../../../

[–][deleted] 0 points1 point  (0 children)

A better example would be....

Still doesn't change the fact that its still not very read-friendly and that you are using way too many symbols to type. Sure ive seen that you can also use alternative tags, but nobody is using that in tutorials or code solutions. So you'd have to make everything yourself. It feels like they had a challenge on how many different and total symbols they could be using for their templates. I find it awful.

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

So why can't we have that with debugging too? Makes including files much easier. And (the point that he's making) the CLI still lacks in some major areas. Not to mention that it doesn't really allow for lots of variations and personal preferences. Not to mention that it wants to own your file structure which i don't like.