Hi
i want make some ‘notice’ function, so i tried make notice list(accordion), load json use $http.get, and disable sceProvider, put iframe.
in self test, Iframe multiple stuck in one of the accordion.
here’s my notice.html
<ion-view title="{{title}}">
<ion-nav-buttons side="left">
<button menu-toggle="left" class="button button-icon icon ion-navicon icon-white"></button>
</ion-nav-buttons>
<ion-content class="has-header">
<ion-list>
<div ng-repeat="notice in notices | reverse">
<ion-item class="item-stable" ng-click="togglesnotice(notice)"
ng-class="{active: isnoticeShown(notice)}">
<i class="icon" ng-class="isnoticeShown(notice) ? 'ion-minus' : 'ion-plus'"></i>
{{notice.title}}
<small> {{notice.date}}</small>
</ion-item>
<ion-item class="item-accordion"
ng-repeat="item in notices | reverse"
ng-show="isnoticeShown(notice)">
<iframe ng-src="{{item.description}}" width="100%" frameborder="0" height="100%"></iframe>
</ion-item>
</div>
</ion-list>
</ion-content>
and here’s my NoticeController
.controller('NoticeController', ['$scope', '$http', '$ionicLoading', function ($scope, $http, $ionicLoading) {
$scope.notices = [];
$http.get('/*json url*/').success(function (data) {
$scope.notices = data;
}).error(function () {
$ionicLoading.show({ template: 'Check network connection', noBackdrop: true, duration: 10000 });
});
$scope.title = 'notice';
$scope.togglesnotice = function (notice) {
if ($scope.isnoticeShown(notice)) {
$scope.shownnotice = null;
} else {
$scope.shownnotice = notice;
}
};
$scope.isnoticeShown = function (notice) {
return $scope.shownnotice === notice;
};
});
Who can help me?