Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Controller
- .controller('ProgramacaoCtrl', function ($scope, $http) {
- //Gets the list of the taxonomy
- $http.get('http://104.236.99.94/wp-json/wp/v2/terms/data').then(
- function(data){
- $scope.dias = data.data;
- }, function(err){
- console.log(err);
- })
- // Gets the custom post ty
- $http.get('http://104.236.99.94/wp-json/wp/v2/atividade?filter[terms]=data&filter[meta_key]=horario_inicio&filter[order]=ASC&filter[orderby]=meta_value_num').then(
- function(data){
- $scope.atividades = data.data;
- }, function(err){
- console.log(err);
- })
- });
- //Views template
- //It lists the posts inside the taxonomy, but it shows all the posts, intead of showing only the posts in the taxonomy.
- <ion-view view-title="Programação">
- <ion-content class="padding">
- <div class="list list-inset">
- <label class="item item-input">
- <i class="icon ion-search placeholder-icon"></i>
- <input type="text" placeholder="Busca" ng-model="busca">
- </label>
- </div>
- <div ng-repeat="dia in dias">
- <h2 class="title">{{dia.name}} </h2>
- <ion-list>
- <ion-item ng-repeat="atividade in atividades | filter:busca" href="#">
- <h2 ng-bind-html="atividade.title.rendered">{{ atividade.title}}</h2>
- <p>
- <span>{{ atividade.acf.horario_inicio}} - {{ atividade.acf.horario_termino}}</span> -
- <span> {{ atividade.acf.local}}</span>
- </p>
- </ion-item>
- </ion-list>
- </div>
- </ion-content>
- </ion-view>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement