html - how to use the get() function in the $http service -


i learning $http service not clear on regarding get(). below code doesn't execute demo2.htm. please check , advise made mistake.

var app = angular.module('myapp', []); app.controller('urlctrl', function($scope, $http) {   $http.get('demo2.htm').then(function(response) {       $scope.mywelcome = response.data;   }); }); 

it seems $http service not you're looking if you're trying access resource same location html/js files. 1 of following should better suit situation:


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -