Feedback plugin within MVVM - Javascript


Thanks for the plugin, works fine fine from .js, but can’t get it to work from the view-model.
I have this on my VM:

var FeedbackPlugin = require("nativescript-feedback");
var feedback = new FeedbackPlugin.Feedback();
function sidebarViewModel() {

var viewModel = new observableModule.fromObject({
onOpenDrawerTap : function(){
var sideDrawer = frame.topmost().getViewById("sideDrawer");
onCloseDrawerTap : function(){
var sideDrawer = frame.topmost().getViewById("sideDrawer");
onToggleDrawerState : function(){
var sideDrawer = frame.topmost().getViewById("sideDrawer");{
title: "success",
message: "Info is relevant data, not just any data."

return viewModel;
module.exports = sidebarViewModel;

The "onToggleDrawerState " is bounded to the UI thrugh xml file as follows:

<NavigationButton icon="res://menubar" tap="{{onToggleDrawerState}}"/>

but I always get this error: Cannot read property ‘success’ of undefined

any help!!!



all of a sudden it start to works, after few builds …

Thanks all


You probably never did a full build (refresh of the platforms folder) after adding the plugin. Next time (and in case it really is a problem with the plugin) feel free to post an issue on my Github project page instead of here.