0

in my angularjs app i have this script for mibew chat in my body where is all my script

<script type="text/javascript">Mibew.ChatPopup.init({"id":"58cfa9cad9451969","url":"http://steora.com\/mibew-chat\/chat?locale=en&email={{authentication .username}}.com&name={{authentication .username}}","preferIFrame":true,"modSecurity":false,"width":640,"height":480,"resizable":true,"styleLoader":"\/mibew-chat\/chat\/style\/popup"});

i need set username and email{{authentication .username} and {{authentication .email}}.

In my indexCtrl.js i do this

$scope.authentication.username = 'Tom';
$scope.authentication.email= '[email protected]';

But this not working.

Can someone tell my how to scope data to Thnx


EDIT: i try solution from @KoIIIeY but if i try to use this, everytime i click on chat icon, its opened in new tab not in popup, and there is no data from email and username. I need to find solution how to pass this data from controller

$scope.authentication.username = 'Tom';

$scope.authentication.email= '[email protected]';

to index.html.

<script type="text/javascript">Mibew.ChatPopup.init({"id":"58cfa9cad9451969","url":"http://steora.com\/mibew-chat\/chat?locale=en&email=_____HERE_____&name=____HERE____","preferIFrame":true,"modSecurity":false,"width":640,"height":480,"resizable":true,"styleLoader":"\/mibew-chat\/chat\/style\/popup"})></script>
3
  • Why not just call init with needed params? Commented Mar 21, 2017 at 11:14
  • Can you please show me how to do that? Thanks Commented Mar 21, 2017 at 11:15
  • look at my answer. Commented Mar 21, 2017 at 11:18

1 Answer 1

1

in indexCtrl.js

$scope.init = function(){
    Mibew.ChatPopup.init({"id":"58cfa9cad9451969","url":"http://steora.com\/mibew-chat\/chat?locale=en&email="+$scopeauthentication.email+".com&name="+$scopeauthentication.username+"","preferIFrame":true,"modSecurity":false,"width":640,"height":480,"resizable":true,"styleLoader":"\/mibew-chat\/chat\/style\/popup"});
}

in view

<body ng-init="init()"></body>
Sign up to request clarification or add additional context in comments.

2 Comments

ok i add this like @kellley say.... but now i get error "Uncaught TypeError: Cannot read property 'open' of undefined at HTMLAnchorElement.onclick"
object where Property 'open' is undefined.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.