功能站菜单($范围){
$.ajax({
url: "/users/station_names_ajax",
type: "POST",
success: function(data){
$scope.phones = [
{"name": "Nexus S",
"snippet": "Fast just got faster with Nexus S."},
{"name": "Motorola XOOM™ with Wi-Fi",
"snippet": "The Next, Next Generation tablet."},
{"name": "MOTOROLA XOOM™",
"snippet": "The Next, Next Generation tablet."}
];
//console.log(Stations);
}
});
// $scope.phones = Stations;
// console.log(Stations);
}
好像我在哪里做这个
function stationMenu($scope){
$scope.phones = [
{"name": "Nexus S",
"snippet": "Fast just got faster with Nexus S."},
{"name": "Motorola XOOM™ with Wi-Fi",
"snippet": "The Next, Next Generation tablet."},
{"name": "MOTOROLA XOOM™",
"snippet": "The Next, Next Generation tablet."}
];
}
它工作....我怎样才能让它在ajax中工作