Angular: Ajax request

Asked

Viewed 193 times

0

Shouldn’t the code below be working? I already tested on console and the text in the 'test' file is coming normally, only does not appear when I call with the //demo.msg//.

Where am I going wrong?

SCRIPT

var app = angular.module('app', []);

app.config(function($interpolateProvider){
    $interpolateProvider.startSymbol('//');
    $interpolateProvider.endSymbol('//');
});

app.controller('DemoController', function($scope, $http){
    $http.get("/teste").then(function(response){
        $scope.msg = response.data;
    });
});

HTML

<div ng-app="app" ng-controller="DemoController as demo">
    //demo.msg//
</div>
  • You’re making {{ msg }} just, right?

  • Just take the demo anyway. The keys were not missing, as I am using the Laravel Slide, I needed to change the Angular pattern from {{ to //. Thanks!

  • Blade comments like this: {{-- msg --}}.

  • But I’m glad it worked out.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.