Sending msg.payload from external javascript file

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

There are some examples in this article: