How to assign $mod.myfunc of delphi to js ?

Hi , 

i am trying to call Delphi function in my JS ,
in my code ...

    type 
        ...
    public //private also the same , cannot work. 
        procedure myFunc( p1:integer );

    end ;
...
implementation 

procedure TmyForm.myFunc( p1:integer );
begin
    showmessage( inttostr(p1) );
end;

procedure TmyForm.WebFormCreate( sender: TObject);
begin
    asm
         //jsOnClickFunc is a onClick that i defined in my html ,let say a button onClick.
         jsFuncOnclickFunc = function(p1) {
               $mod.myFunc( p1 ) ; //this won't work , as console will picked up it as not a function error.
         }

    end ;
end ;


Please advice. 
Thanks.

Hi , my mistake , should not define the function in both private or public section.

i have solved this, thanks.