angular.module('BeautyCare', ['ionic'])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('tabs', {
url: "/tab",
abstract: true,
templateUrl: "templates/tabs.html"
})
.state('tabs.Store', {
url: "/Store",
views: {
'Store-tab': {
templateUrl: "templates/Store.html",
controller: 'StoreTabCtrl'
}
}
})
.state('tabs.SalonGalary', {
url: "/SalonGalary",
views: {
'SalonGalary-tab': {
templateUrl: "templates/SalonGalary.html",
controller :'SalonGalaryCtrl'
}
}
})
.state('tabs.Profile', {
url: "/Profile",
views: {
'Profile-tab': {
templateUrl: "templates/Profile.html"
}
}
})
.state('tabs.Alerts', {
url: "/Alerts",
views: {
'Alerts-tab': {
templateUrl: "templates/Alerts.html"
}
}
});
$urlRouterProvider.otherwise("/tab/Store");
});
.controller('StoreTabCtrl', function($scope,$http,$log) {
var items =null;
$log.debug('start debug');
var url="http://open.api.ebay.com/shopping?GLOBAL-ID=EBAY-IN&QueryKeywords=Iphone&ResponseEncodingType=JSON";
url+="&appid=API_ID&callback=JSON_CALLBACK._0";
url+="&callname=FindPopularItems&version=713?callback=JSON_CALLBACK";
$log.debug($http.jsonp(url)
.success(function(data) {
items=data;
console.log(items);
})
.error(function(data) {
//alert("ERROR");
}));
});
<html >
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Beauty Care</title>
<!-- MyBeauty , BeautyCare,BeautyEye,BeautyShop,BeautySalon !-->
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="js/app.js"></script>
<script src="js/Service.js"></script>
<script src="js/Controllers.js"></script>
<!-- <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBLSOMXsw_sxOlRpyBj16g5iaewLHDpSes&libraries=places"></script>
-->
</head>
<body ng-app="BeautyCare">
<ion-nav-bar class="bar-positive">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
<script id="templates/tabs.html" type="text/ng-template">
<ion-tabs class="tabs-icon-top tabs-positive">
<ion-tab title="" icon="ion-ios-cart" href="#/tab/Store">
<ion-nav-view name="Store-tab"></ion-nav-view>
</ion-tab>
<ion-tab title="" icon="ion-navicon-round" href="#/tab/SalonGalary">
<ion-nav-view name="SalonGalary-tab"></ion-nav-view>
</ion-tab>
<ion-tab title="" icon="ion-android-person" ui-sref="tabs.Profile">
<ion-nav-view name="Profile-tab"></ion-nav-view>
</ion-tab>
<ion-tab title="" icon="ion-ios-bell" ui-sref="tabs.Alerts">
<ion-nav-view name="Alerts-tab"></ion-nav-view>
</ion-tab>
</ion-tabs>
</script>
<script id="templates/Store.html" type="text/ng-template">
<ion-view view-title="BeautyCare Store" cache-view="false">
<ion-content class="padding" >
<ion-list>
<ion-item class="item-icon-right" ng-repeat="item in items">
<h1>{{item.TimeStamp }}</h1>
<!--<p>{{ item.title}}</p> !-->
<i class="icon ion-chevron-left icon-accessory"></i>
<ion-option-button class="button-positive" ng-click="viewFriend(viewFriend(data.idfriends))">View Friend</ion-option-button>
<ion-option-button class="button-assertive" ng-click="deleteFriend(remove(data.idfriends))">Delete</ion-option-button>
</ion-item>
</ion-list>
</ion-content>
</ion-view>
</script>
<script id="templates/SalonGalary.html" type="text/ng-template">
<ion-view view-title="BeautyCare Salon Galary" cache-view="false">
<ion-content class="padding">
</ion-content>
</ion-view>
</script>
<script id="templates/Profile.html" type="text/ng-template">
<ion-view title="My Profile" cache-view="false">
<ion-content>
</ion-content>
</ion-view>
</script>
<script id="templates/Alerts.html" type="text/ng-template">
<ion-view view-title="My Alerts" cache-view="false">
<ion-content class="padding">
</ion-content>
</ion-view>
</script>
</body>
</html>
</body>
</html>
我試圖用$ http.get沒有運氣,代碼顯示意外的錯誤。 我感謝任何幫助解決這個問題或解決方法使用$ http.get。我嘗試了不同的例子,但仍然沒有解決問題。在此先感謝
如果您只發布代碼和錯誤圖片,沒有人會幫助您解決問題,特別是如果兩幅圖片都不顯示完整詳細信息,則不會提供幫助。將代碼的文本與錯誤消息的完整文本一起復制到您的問題中。 –
謝謝盧克,我將編輯併發布代碼 –
我要求您在問題中也包含錯誤消息的文本。請修改您的問題以包含該問題。 –