Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell
I need to code Angular but I'm not very good at it, can anyone help with this.

The situation is that I have this component that manages a fairly complicated view. It already does a lot of view-related things, and I can't really break it up into any smaller pieces.

Problem is, that in order to use this view, I need to make 3 or 4 separate api calls and bang that data together to get anything useful. Right now, all this logic is in one service that both makes the actual api calls and then processes the data. This file is getting bigger than I would like, and it feels really tightly coupled with the view component.

I'm not sure how to refactor anything though. Ultimately I would probably like to have a thin service without any logic that contains all the api calls, but I'm not sure where to put the rest of my code. Should I make a second service that calls the first one? Or should I make a separate component that processes the data and has the view component as a child? In React, the stateful vs pure component separation feels easier to reason with but like I said, I'm bad at Angular.

Adbot
ADBOT LOVES YOU

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell

HaB posted:

I haven't seen your code, but I already disagree with the bolded part.

Also: AngularJS or Angular?

Based on what you describe, I'd wager it can be broken up on the basis of what each of your API calls provides, unless they are dependent on each other - eg. Call 1 gets a vale that Call 2 needs and Call 2 gets a value that Call 3 needs, etc.

But hard to tell without seeing code or a more detailed description.

It's Angular, should be the latest version. I spent few hours refactoring my code by moving all the logic into a separate component and pushing data to the other component with @input hooks. It feels simple enough but I guess I need to show it to somebody and see if they can understand it.

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell
I haven’t used Vue but I heavily dislike the Angular templates because

a) I keep forgetting the syntax while JSX is just Javascript so I already know it

b) there’s no linting for the template directives and simple mistakes inside the template file can be really hard to find because Angular error messages suck

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell
Github Packages looks pretty promising, but there will so much loud screaming about Microsoft if it starts catching on

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell
Is it just me or are all JS build tools garbage? I decided to try Parcel because someone told me that it’s the new hotness and it just works without any config. Everything indeed worked initially but when I wanted to add Tailwind it just fails to work without any errors. Parcel, Postcss and Tailwind all have a documentation about how to make them them work with each other and it feels I’ve tried everything but again, debugging this poo poo is hard when there’s no error messages.

Btw I didn’t really post this as a plea for help, I’ll figure it out later or just go back to webpack. It’s just annoying since I wanted to build the loving web page instead of toying with config files.

Edit: solved by linking the css from js instead of html, no idea why

Obfuscation fucked around with this message at 11:35 on Jan 28, 2020

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell
Are there any simple and straightforward tools that convert markdown into static html files? Preferably node-based. This is for a personal toy project so I might as well reinvent the wheel here because I need a fairly limited feature set, but if there’s an existing solution I’d rather use that.

edit: I think I'll use PostHTML

Obfuscation fucked around with this message at 12:47 on May 25, 2020

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell
I couldn’t survive a single day at work without MDN so I hope that it can be saved somehow

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell
You can iterate through the values of a string enum but not union types, so that's one thing that they have going for them

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell

bvj191jgl7bBsqF5m posted:

We all agree that Angular sucks

God I hate Angular, I spent the entire day today figuring out this poo poo which obviously isn't documented anywhere and produces totally incomprehensible error messages. How can it be so loving hard to make a dynamic form that is configurable at runtime? Isn't that why we have all this frontend poo poo in the first place? And let's not even talk about splitting a form in two or more components, I don't even know if that is theoretically possible. Angular is just a horrid pile of complexity piled on top of complexity, and there's no reward to any of it.

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell
React documentation also tells you to use Next and create-react-app isn't updated anymore. I guess you can just set up a new node project with your favorite bundler but that's probably too many fiddly bits to include in the official documentation.

Adbot
ADBOT LOVES YOU

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell
Tailwind is certainly fine but if you want to put the least amount of effort into css and still have something that looks good I'd use some CSS library that comes with premade components, like Bootstrap or Fomantic UI

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply