Не помогло.
[url]<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Angular JS</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="weather.js"></script>>
</head>
<body ng-app="jsbin">
<div ng-controller="DemoCtrl as vm">
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.7/weatherscript.js"></script>
<script src="weather.js"></script>
<h1><b>{{vm.data.city.name}}</b></h1>
<h1><b>{{vm.data.list[0].temp.day}}</b></h1>
</div>
</body>
</html> [/html]
И скрипт.
var app =angular.module('jsbin', []);
app.controller('DemoCtrl',[ function($http) {
var vm = this;
var temp1=[];
var URL = 'http://api.openweathermap.org/data/2.5/forecast/daily';
var request = {
method: 'GET',
url: URL,
params: {
q: 'KansasCity',
mode: 'json',
units: 'imperial',
cnt: '7',
appid: '3ac1f68b653ffbf72a5f782420062771'
}
};
$http(request)
.then(function(response) {
vm.data = response.data;
temp1[0]= angular.fromJson(response.data);
console.log(temp1[0]);
console.log(temp1[0].city.name);
console.log(temp1[0].city.country);
console.log(temp1[0].list[0].temp.day);
}).
catch(function(response) {
vm.data = response.data;
});
}
// console.log(temp);
]);
Ну и манифест
{
"manifest_version" : 2,
"name" : "...",
"short_name" : "...",
"version" : "1.0",
"author" : "...",
"description" : "...",
"icons" : {
"16" : "icons/16x16.png",
"32" : "icons/32x32.png",
"48" : "icons/48x48.png",
"64" : "icons/64x64.png",
"128" : "icons/128x128.png"
},
"content_scripts": [
{
"matches": [ "*://*/*" ],
"js": [ "weather.js" ]
}
],
"background" : {
"scripts" : ["background.html"],
"persistent" : false
},
"browser_action": {
"default_title": "...",
"default_icon": "icons/water.png",
"default_popup": "popup.html"
}
}