javascript – Save or cancel changes with View

I'm trying to create the Save and Cancel feature.

I have the respective buttons:


        
        
        
        {{}} I18nTexts.btnCancel
      
      
        
        
        
        {{}} I18nTexts.btnConfirm
       

but I can not run the method properly to create the function.

How could I do it correctly?