8
When Google searches for Angular, it is returned:
- I know that MVC means Model-View-Controller but what is the W of MVW Framework?
- Is this a new standard software architecture? A new Pattern design?
- As it differs from "traditional" MVC, MVVM, MVP?
8
When Google searches for Angular, it is returned:
13
I warn you that this is a controversial topic that many developers can spend hours and hours debating and discussing, but I will try synthesize a little bit of information.
The MVW standard is not actually a standard, MVW, meaning Model-View-Whatever, IE, whatever standard you think will program in Angularjs, do not waste time, just do. Simply what works for you.
For several years, Angularjs was closer to MVC (or rather one of the client-side variants), but over time and thanks to many refactoring and API improvements, it is closer to MVVM - the object of $ Scope can be considered the View-Model that is being decorated by a function that is called Controller.
**The MVW standard is not really a standard, MVW means Model-View-Whatever, I mean, whatever, don’t waste time and keep arguing about these absurd things MV*, just do.
<input type='text' id='bind-input'>
<label id='bind-output'></label>
And Javascript:
window.addEventListener('load', function() {
var input = document.getElement('bind-input'),
output = document.getElement('bind-output');
input.addEventListener('change', function() {
output.innerText = input.value;
});
});
We have to explain very specifically what we need the browser to do. We have to use the Listener of certain events, make sure that the DOM is loaded, track the ID’s of our element, all to update the label every time the input changes.
<input type='text' id='bind-input'>
<label id='bind-output'></label>
And we still need Javascript:
$(document).ready(function() {
var $input = $('#bind-input'),
$output = $('#bind-output');
$input.on('change', function() {
$output.html($input.value());
});
});
As you can see, this is quite similar to the DOM approach. We need to explain to the browser exactly what we want to do.
<input type='text' ng-model='bound'>
<label ng-bind='bound'></label>
Nor do we need to write any code for this to work with Angular. (Obviously, we need a controller empty somewhere, but you can understand the idea).
The declarative approach is primarily a way to abstract the implementation details. Angular guidelines make it very easy to complete these common behaviors into small reusable components than can be applied to our HTML in a declarative form.
Angularjs gives a lot of flexibility to separate the logic of presentation from the logic of business and the state of presentation. All these denominations actually only separate the logical part from the visual part, no matter what it is. Angularjs makes this very explicit when you create a controller where the data will be processed and HTML with the directives where the data will be exposed.
I think I’ve got an idea =)
Browser other questions tagged angularjs terminology
You are not signed in. Login or sign up in order to post.
Whatever .
– Jéf Bueno
Sérião. I’m just not going to answer the question because eventually Onosendai will appear here and give a good answer. If he doesn’t appear I’ll write something.
– Jéf Bueno
It really means Whatever https://plus.google.com/+AngularJS/posts/aZNVhj355G2 but I’m waiting for a good answer from Onosendai
– Jeferson Almeida
@jbueno You can answer, I am in meeting all day
– OnoSendai
In fact it is that same rs, including this has already been answered in Stack Overflow English, referencing the same link passed by Jeferson. I would answer, but I think it would be disrespectful to @jbueno who commented first.
– Alisson