# Sending msg.payload from external javascript file

**URL:** <https://discourse.nodered.org/t/sending-msg-payload-from-external-javascript-file/48660>\
**Category:** Dashboard\
**Created:** [20 July 2021 14:10 UTC](https://discourse.nodered.org/t/sending-msg-payload-from-external-javascript-file/48660 "2021-07-20T14:10:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oualid](https://avatars.discourse-cdn.com/v4/letter/o/8dc957/32.png) [@oualid](https://discourse.nodered.org/u/oualid)\
**Post date:** [20 July 2021 14:10 UTC](https://discourse.nodered.org/t/sending-msg-payload-from-external-javascript-file/48660/1 "2021-07-20T14:10:07Z")

</div>

Hi, I am not good at Angular JS.  
I am trying to send an msg.payload from external js file linked to dashboard template, see the code below.

function sendMsg(elemnetId) {  
angular.module('send', )  
.controller('Controller', ['$scope', function($scope) {  
$scope.send = {payload: elemnetId};  
}]);

But it doesn't work and nothing display in the debug node .  
it's possible to sending and receiving messages payload to/from external javascript!  
could you please help me  
thank you

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [20 July 2021 21:51 UTC](https://discourse.nodered.org/t/sending-msg-payload-from-external-javascript-file/48660/2 "2021-07-20T21:51:35Z")

</div>

There are some examples in this article:

> **[Node-RED Dashboard Template Examples (AngularJS)](https://it.knightnet.org.uk/kb/nr-qa/dashboard-template-examples/)**
>
> Some examples of using AngularJS with the Node-RED Dashboard.
> Not all features of Angular are accessible via the Dashboard.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [19 August 2021 21:51 UTC](https://discourse.nodered.org/t/sending-msg-payload-from-external-javascript-file/48660/3 "2021-08-19T21:51:37Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
