We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Define value in client script

YashikaG
Tera Contributor

Hello team, how can I define value in client script in Service Portal and how to show it in HTML?

1 ACCEPTED SOLUTION

Not applicable
Hello @YashikaG ,
Use can use below code. It will work.
var c = this; 
$scope.val = "val1";
c.data.sndval = "val2";
 
HTML:
<p>
    {{c.data.sndval}}
  </p>
  <p>{{val}}</p>
<p ng-bind="data.sndval">
  
</p>
 
<p ng-bind="val">
  
</p>

Please mark my response correct and helpful, if it helps you.
Please reply if any issue happens.

View solution in original post

5 REPLIES 5

PritamG
Mega Guru

Client Script:

$scope.myValue = "Hello, Service Portal!";

HTML:

<h1>{{ myValue }}</h1>