2015-02-17 15:09:23
JavaScript
, 2015-02-17 15:09:23

Angular: how to get executable code out of base?

How to execute the code inserted by Angular?
according to the instructions i have to do this:

app.controller('PageCtrl', function($scope, $http, $routeParams){
  $scope.page = null;
  $scope.slug = $routeParams.slug;
  $http.get('yandex.ru/index.php/pages/'+$scope.slug)
    .success(function(response){
  document.title = pretitle + ' - ' + response[0].title;
//alert(JSON.stringify(response[0]));        
$scope.page = response[0];
    });
});

yandex.ru is for example...
Add ng-app to the container
Add a map for output obtained from json:
<script charset="utf-8" type="text/javascript">
...
//Допустим alert('this');
<script>

and nothing gets executed, why?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question