mercredi 18 février 2015

Extract meta infromation from URL in angularjs


I am trying to extract the meta-information(title, image) from URL and display it like facebook. I have read some documents and written this code. Since i am new in angular. I dont get it where i am doing wrong



var myApp=angular.module('myApp',[]);
function MyCtrl($scope,$http){
$http.get('www.socialorra.com').
success(function(data,status,headers,config){
$scope.url=$(data).filter('meta[name=title]').attr("content");
}).
error(function(data,status,headers,config){

});
}




Aucun commentaire:

Enregistrer un commentaire