I am creating a mobile app with the AngularJS and Ionic framework, I have a full of data loaded with Ajax Category page (see code below), when I click on a category, pages with category posts are displayed (content is also loaded with AJAX), when I click the back button (category page) On), AJAX refuses to return data, but success Shan killed. I would like to see how to correct this behavior.
.controller ('SubMenuCtrl', function ($ scope, $ http, $ state, $ stateParams, $ rootScope) {$ scope.itemsSubMenu = {}; id = $ stateParams.ID; Id_cat1 = $ stateParams.id_cat; var response light = $ http.get ("http://monguidepratique.com/mobile/getCategories.php?parent_id=" + id + "& id_cat =" + id_cat1); Reprint Publish. Success (function (data, position, header, config) {warning ('data' + id + '' + idcart1); if (data. Category == 'category') {$ scope.itemsSubMenu = data.catgs;} And {warning ('redirect'); $ state.go ('app.postpage', {'id_cat': id_cat1})}}}); Response Response: Terror (function (data, Status, Header, Config) {Warning ("AJAX Fails!");})}}
And this is my position:
.state ('App.menuitempage', {url: "/ menuitempage /: id /: id_cat", idea: {'menu content': {templateUrl: "templates / menuitempage.html", administrator: 'SubMenuCtrl'}}}) < / Code>
and this is mycategory .htm L page
& lt; Ion-view title = "category item" & gt; & Lt; Ion-nav-bar class = "nav-title-slide-ios7 bar-positive" & gt; & Lt; Ion-nav-back-button class = "button-icon ion-arrow-left-c" & gt; & Lt; / Ion Neo-Back Button & gt; & Lt; / Ion neo-bar & gt; & Lt; Ion-content class = "is-header" & gt; & Lt; Ion-list & gt; & Lt; Ion-item ng- repeat = "menusbitim" items in "menu" ng- href = "# / app / menu / page {{menusubitem.ID}} / {{menusubitem.id_cat}}" & gt; & lt; class = "Item-icon-right" & gt; {{menusubitem.title}} & lt; i class = "icon ion-chevron-right" & gt; & lt; / i & gt; & lt; / a & gt;
Comments
Post a Comment