javascript - Bind AngularJS variables into inline script tag -


i have need add in items scope inline script need run on site.

from have tried in demo doesn't possible use values scope in inline script tags. best way achieve this

<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.js"></script>  <div ng-app="app">          <div ng-controller="mainctrl">          '{{aaa}}'           <script>console.log('{{aaa}}');</script>      </div>  </div>  <script>  'use strict';  var app = angular.module('app', []);  app.controller('mainctrl', ['$scope', function ($scope) {    $scope.aaa = 'bbb';  }]);  </script>

console returns '{{aaa}}' want return bbb

    <div id="idd" ng-controller="mainctrl">         '{{aaa}}'         <button ng-click="$log.log(aaa)">log</button>       </div> </div> <script>     'use strict';     var app = angular.module('app', []);     app.controller('mainctrl', ['$scope','$log',          function($scope,  $log) {             $scope.aaa = 'bbb';             $scope.$log = $log;             //console.log($scope.aaa);             //console.log($scope.$parent);         }     ]); </script> 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -