
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2019 05:01 PM
Hi All,
I am trying to pass the below value from Client Controller to Server Script: The below script runs when a Link is Clicked on the service portal page.
HTML :
<tr ng-repeat="item6 in data.incitems_arr track by $index">
<td>
<h4><a ng-mousedown="c.show($index)" href="{{item6.url}}" target="_blank" class ="one"> {{item6.title}} </a></h4>
</td>
</tr>
Client Controller:
this.show = function(i) {
c.data.i = i;
alert("You pressedlink: " +c.data.i); // This is alerting the right index number
console.log('this is test');
this.server.get({
id:c.data.i
});
}
Server Script:
if (input.id) {
gs.info('hello is:'+success); ---- > It is not going inside of if loop
}
Note: There is already a script running on load of the page, which is sending data to the server script
$scope.loadData = function(callback) {
$scope.data.action = "loadData";
$scope.server.update().then(function(){
console.log(c.data.articlesObject);
});
};
Help is appreciated.
Thank you.
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2019 06:14 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2019 06:14 PM
Thanks all.
I got the answer that I needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 08:46 AM
I have similar requirement could you please help me

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 12:14 PM
Hello,
try something like below:
Client Script:
function($scope, spUtil, $sce) {
var c = this;
this.show = function(i) {
c.data.i = i; // try to assign values outside of get.
c.server.get().then(function(){
c.data = {}
});
}
}
}
Server Script :
if (input.i == '??') {
// --->write your code here
}
Let me know if this works
Regards,
Dheeraaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 05:54 AM
This is not working. Getting undefined in server script
CLient code
api.controller = function($scope) {
/* widget controller */
var c = this;
this.show = function(i) {
c.data.i = 'this is my short description';
c.server.get().then(function() {
c.data = {}
});
}
}
//};
Server code
(function() {
gs.info("client="+input.i);
})();