What is MVVM, and should we use it ?

What is MVVM , and should we use it ?

Asked on December 8, 2018 in knockout js.
Add Comment


  • 2 Answer(s)

        The  on-event attributes  only refer to things that placed in the global scope. This refers to keep all need to access in the global scope, which leads to very messy code.

        In declarative bindings, the original meaning of the bindings instead based on the context.

        This make  the HTML markup as more coincidental. The really wanted one is structured access to the view model. Think of with and forEach as nested contexts and of the other bindings as their attributes. The relationship between the declarative bindings and the underlying HTML suddenly feels more like working with XSLT.

        The 2 examples look like same . But the underlying concepts are vary and are create the  data binding as so powerful and on-event attributes so obnoxious.

        The reason on-event attributes are frowned upon isn’t just that they mix logic with structure. It’s a bad attempt to bolt arbitrary JavaScript code to HTML elements which stop regular encapsulation of application logic. On-event attributes are low-level “hooks”, bindings extend the behavior of elements.

        All that said, it is likely possible to do the same horrible things people have done with on-event attributes by using the  declarative bindings. The difference is in what other thing is do in this . Do not  judge technologies by how they can be abused.

    Answered on December 8, 2018.
    Add Comment

        This Knockout (mvvm)  is used to make it simple to combine the  views to a Model – a View Model – thus permit all to  stop writing a lot of boilerplate code just to get back values from the view.

    Use this code :

    var ex = {
        some1: $('#textbox1').val(),
        some2: $('#textbox2').val()
    };
    

        The drawback is  littered throughout the web application and it becomes highly uncomfortable to handle . With this Knockout, whenever the View is updated, The  View Model will be updated as well.

        All the  application is not needed this, and do not use this although it is easy to use . There obviously needs to be a reason to use it, the example above is one reason.

    Answered on December 11, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.