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

testing - Detect whether test has failed within fixture -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -