UNPKG

nooljs

Version:

Full stack JavaScript framework created top of Nodejs, express, and Socket-io, and Angularjs

23 lines (19 loc) 629 B
var app = angular.module('myApp', ['nooljs', 'ionic']); app.run(['nlUtil', function (nlUtil) { nlUtil.useWebsocket(true); }]); // Test controller for the server side method app.controller("myController",['nlServerMethods', '$scope', function(nlServerMethods, $scope) { $scope.serverResult= "my result"; $scope.onclick= function(){ nlServerMethods.exec( "myMethods.myServerMethod1", "First", "parameter") .then(function(data){ $scope.serverResult = "data :" + data.data + " , error :" + data.error; }) .catch(function (err) { $scope.serverResult = " error :" + err; }); }; }]);