javascript - Bind three select menus together -
i have json data in link below:
first select menu belongs series. second select menu belongs chapters , third belongs pages. when change first select menu naruto 1 piece has load 1 piece chapters , last 1 piece chapter. how can achieve this?
<select class="browser-default" ng-model="myoption" ng-options="manga.seri manga in bilgiler1"> <option value="" disabled selected>select manga</option> <option></option> </select> <select class="browser-default"> <option value="" disabled selected>chapter</option> <option></option> </select> <select class="browser-default"> <option value="" disabled selected>page</option> <option></option> </select> <img ng-repeat="" ng-src="/{{}}">
javascript:
.factory('mmg', function($http){ var fveg= {}; var url = 'http://api.mangayurdu.com/manga?callback=json_callback'; fveg.adlar = $http.jsonp(url); return fveg; }) .controller('nbgctrl',function ($scope, mmg) { mmg.adlar.success(function(lohemen) { $scope.bilgiler1 = lohemen; }) })
you can keep array of mangas each manga object keeps chapters , each chapter keeps page count.
then use ng-repeat
run through mangas did, run through chapters of selected manga , on pages of selected chapter.
here working fiddle of concept.
Comments
Post a Comment