@med001 wrote:
I make a rest api but now in display data retrieved from the database it displayed nothing
Here javascript code
` run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);cordova.plugins.Keyboard.disableScroll(true); } if(window.StatusBar) { StatusBar.styleDefault(); }
});
}).config(function($stateProvider,$urlRouterProvider){
$stateProvider.state("actualite",{
url : "/actualite",
templateUrl : "templates/actualite.html",
controller:"getactualites"
});$stateProvider.state("infoActualite",{
url : "/infoActualite",
templateUrl : "templates/infoActualite.html",
controller:"infoActualiteCtrl"
});$stateProvider.state("contact",{
url : "/contact",
templateUrl : "templates/contact.html"
});$stateProvider.state("geo",{
url : "/geo",
templateUrl : "templates/geo.html"
});$stateProvider.state("config",{
url : "/config",
templateUrl : "templates/config.html"
});//pour afficher page index
$urlRouterProvider.otherwise("actualite");})
.controller("getactualites",function($scope,$http){
$http.get('link api')
.then(function successCallback( response ) {
$scope.data = response;
}, function errorCallback() {
alert('error');
})});
`code view
`
<a class="item item-thumbnail-left" ng-repeat="actualite in allactualites.actualites"> <img src="../img/ionic.png"> <h2>{{actualites.id}}</h2> <h2>{{actualites.nomactualite}}</h2> <p>blaaaa</p> </a> </div>
`
Posts: 1
Participants: 1