Page 1 of 1

Plugin and Action NeoAppBuilder

PostPosted: Sun Jan 31, 2016 12:39 pm
by anton
Hello. You can plug-in, run the standard action NeoAppBuilder?

Re: Plugin and Action NeoAppBuilder

PostPosted: Sun Jan 31, 2016 12:50 pm
by Tony Kroos
Do you mean how to run nab action from plugin?

Re: Plugin and Action NeoAppBuilder

PostPosted: Sun Jan 31, 2016 1:28 pm
by anton
Tony Kroos wrote:Do you mean how to run nab action from plugin?

Yes. Exactly

Re: Plugin and Action NeoAppBuilder

PostPosted: Sun Jan 31, 2016 4:55 pm
by Neosoft Support
You can't use NeoAppBuuilder's scripting language in a plugin - only JavaScript. However, all NeoAppBuilder actions are converted to JavaScript by the compiler. So if you look at the code created by the compiler for an app you can see the JavaScript equivalents for each NAB action. In most cases you can use similar calls in your plugins.

Re: Plugin and Action NeoAppBuilder

PostPosted: Mon Feb 01, 2016 12:44 am
by anton
Neosoft Support wrote:You can't use NeoAppBuuilder's scripting language in a plugin - only JavaScript. However, all NeoAppBuilder actions are converted to JavaScript by the compiler. So if you look at the code created by the compiler for an app you can see the JavaScript equivalents for each NAB action. In most cases you can use similar calls in your plugins.


It is clear. :) I once watched a code that is obtained after compilation. But to make it workable in the plugin could not.
Code go to the page looks like this:
Code: Select all
NeoApp.controller("NewPage_Ctrl", function($scope,$rootScope,$route,$timeout,$filter,$window,$animate) {
$App.NAB.PageNumber = 1;
$App.NAB.PageID = "NewPage";
$scope.PushButton1_click = function() {debugScriptBegin( 103,"PushButton1","click",1 );
debugScriptRun( 103,"GotoPage \"NewPage\"",0 );
$scope.GotoPage( "NewPage" );
debugScriptEnd( 103 );};
});


It turns out for the transition to a specific page meets function:
Code: Select all
function() {$scope.GotoPage( "NewPage" );

But how do you make it work in the plugin , I do not know.

The program NeoAppBuilder of this design works. A similar plug-in, no.
Code: Select all
BeginJS
$scope.GotoPage( "NewPage" );
EndJS

Re: Plugin and Action NeoAppBuilder

PostPosted: Tue Feb 02, 2016 8:03 pm
by Neosoft Support
This is a bit convoluted, but try this:

var neoApp = angular.element(document.getElementById("ng-view")).scope();
neoApp.GotoPage( "NewPage" );

Re: Plugin and Action NeoAppBuilder

PostPosted: Wed Feb 03, 2016 3:04 am
by luishp
Code: Select all
var neoApp = angular.element(document.getElementById("ng-view")).scope();
neoApp.GotoPage( "NewPage" );


Works!
Thank you!

Re: Plugin and Action NeoAppBuilder

PostPosted: Wed Feb 03, 2016 1:03 pm
by anton
Thank you. Works like a clock , and even better :)