|
The idea of such frameworks is that the html is built for you to reflect your data. In traditional ajax if you called a method that returned ajax and you wanted to show that as a table you'd have to make the table tag and inject it into the page somewhere, you would then loop through each item in the json and make a tr tag and inject that into your table. You'd then go through the properties of the json item and create a td tag per property and attach that. Or let's say you have a shopping basket, each row may well comprise quite intricate and complex html as you might have descriptions, image carousels, add\remove buttons, quantity spinners etc and if your basket is ajax enabled you need to create all that html via js.
With angular you effectively "template" your objects\json. So you say that each item in your json array is a tr, each property is a td, and where on the screen your data is shown. Bind your json array and the table appears. Now in code if you add a new item to your array a new row will magically appear in your table. Delete an object and the row disappears, change a property and the cell changes, re-order your objects and your rows also re-order. So you only need to concerns yourself with making sure the data is up-to-date, and angular ensures the html always reflects that data, you don't have to make the html yourself.
For a basket for example if you want to change the quantity you just find the relevant item in your basket array and update the quantity and the screen reflects that change, even updating totals etc if you're clever (or stupid).
This obviously assumes you handle your data state via objects in javascript and use ajax to amend those objects. If your data is all server-side and your handling of data all server-side then there is little point in using these frameworks.
|
|
|
|
|
Interesting. Thanks.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Terrific answer!
"Go forth into the source" - Neal Morse
|
|
|
|
|
Easy binding DOM to your apps Models via declarative code (versus writing imperative code).
Meaning you can easily bind your Models to the View (DOM) and then the DOM is updated almost magically.
You don't have to write specialized code (imperative programming) that goes through DOM updating view(s).
Of course, there are other supporting features for this functionality.
|
|
|
|
|
I have tried and gave up on it due to amount of ceremony involved to create Angular application. It might be easier to summon a demon then use that pile of **** . It may have improved since I was banging my head with Angular 2 or was it 4 ?
Zen and the art of software maintenance : rm -rf *
Maths is like love : a simple idea but it can get complicated.
|
|
|
|
|
virang_21 wrote: due to amount of ceremony involved to create Angular application. Like I said, I've only been through a few tutorials and I agree with your statement. I don't see the benefit of it just yet.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Hi All,
Had a funny moment, someone in the C++ pen was looking at Code Project. I must admit this concerns me a little, like not making any work place comments ( X is a knob etc.) mind you he wasn't looking at the lounge!..
|
|
|
|
|
Never have I ever.
Of course, most of the programmers I've worked with don't code as a hobby, either.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
He was probably trying to spell "SND CODZZZZZ URGNTZZZZZ!"
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
He seems pretty clued in not a 'SND CODZZZ' type, but as they say... he's a C++ guy...
|
|
|
|
|
I think you missed a "Z" in URGNTZZZZZ.
-- rants are the vehicle of the lazy and uninspired - JSOP 2/2018
|
|
|
|
|
OriginalGriff wrote: probably trying to spell "SND CODZZZZZ URGNTZZZZZ!"
This one got me! LOL!
~George Bernard Shaw When you find something funny search it for hidden*blatant truth.
*My alteration.
|
|
|
|
|
Never that I recall. I have my MVP certificate hanging in my cube and so far no one has commented on it.
And CP is no longer allowed at work because it's SaaS and that means it's malicious.
|
|
|
|
|
Quote: And CP is no longer allowed at work because it's SaaS and that means it's malicious. Well dang!
|
|
|
|
|
PIEBALDconsult wrote: it's malicious.
Yeah, well, some members can be - not to mention any names...
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
Hey!
I resemble that remark!
I'll get my coat...
When you are dead, you won't even know that you are dead. It's a pain only felt by others.
Same thing when you are stupid.
modified 19-Nov-21 21:01pm.
|
|
|
|
|
Nope. I've seen all sorts of other things, but one thing I've come to learn, and this is from directly asking "is coding something you're passionate about" (and I think there have been CP survey's similar to this question) the resounding answer is no. The lack of passion is so profound that I tpyically find that "coders" aren't even interested in sharpening (pun intended) their skills relevant to work. If there's any "training" or "mentoring" done, it seems to be because management forces people to attend classes or watch videos from one of the online training sites. I find it all very sad, and I end of feeling rather lonely as well.
On the flip side, the people I know that are passionate about software development et al, well, it's like walking into an incense smelling crystal and self-therapy new age store except it's full of geeks stringing together words into strange new phrases like "emergent sense making" and whenever one of those utterances is made the rest of the lemurs chant "that is so profound!" Not really my type of crowd either.
Latest Article - Code Review - What You Can Learn From a Single Line of Code
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Agreed. Crafts-people don't sit and talk about the nuances. We're out there building stuff and driving it at 200mph toward the cliff, hoping it'll fly when the ground is gone.
A lot of times, it don't. (And grammar is optional.)
|
|
|
|
|
Marc Clifton wrote: "coders" aren't even interested in sharpening (pun intended) their skills relevant to work
Personally, I'm not real passionate about my primary tasks at work -- it's all drag-and-drop SSIS.
BUT that doesn't mean that I'm not passionate about the things that I do enjoy, and whenever I have a chance to do "real" development (primarily console utilities that help me do everything else), then I'm back in scha-wing-town full-tilt boogie.
What I do want to get back to is writing code for my own home projects, which have stagnated the last few years. This evening I'm back to looking at a new attack on my holy grail of Data Access Layers. I have made several attempts over the last fifteen years, but each inevitably bloats and becomes unmanageable -- so adding new features is impossible. Every few years I have to start fresh with a new feature set.
|
|
|
|
|
Whenever I'm asked "is coding something you're passionate about?" I want to kick the person asking the question in the head until they expire (I don't mean that literally!). What is really being asked? Is the expected answer "I think and talk about code 24/7"? If so then that doesn't leave much time for a real life and I am not that person. One of the definitions of "passion" from Merriam-Webster is "a strong liking or desire for or devotion to some activity, object, or concept". I strongly like programming. Am I "devoted"? Nah. But I have been creating software for over 40 years, have not done any other type of work, and can't imagine doing anything else. And because I have a strong liking for the craft of programming, I keep an eye on the industry, and continuously develop as a programmer. So, if that's "passion" then I'm passionate. Otherwise, whatever... Okay, that was a bit of a rant but I do feel better now.
|
|
|
|
|
The other person I work with is not nerdy enough to hang out here!
"Go forth into the source" - Neal Morse
|
|
|
|
|
So, a non-geek it geek? or a Sales guy who knows what he doing (save me from the most convoluted mess of VB.NET you have everseen)!!
|
|
|
|
|
I'm betting on Purrl...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
No, it's C, I read it in my first book: "A is for apples, B is for balloons, C is for cats ..."
98.4% of statistics are made up on the spot.
|
|
|
|
|
Uh Ooooooh!
Please tell me it was not this book![^]
I have lived with several Zen masters - all of them were cats.
|
|
|
|