This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getPaginatedItems(items, page) { | |
| var page = page || 1, | |
| per_page = 3, | |
| offset = (page - 1) * per_page, | |
| paginatedItems = _.slice(items, offset, offset + per_page) | |
| return { | |
| page: page, | |
| limit: per_page, | |
| rows: items.length, | |
| pages: Math.ceil(items.length / per_page), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div> | |
| <ul class="nav nav-tabs"> | |
| <li role="presentation" v-bind:class="{'active': selected === title}" v-for="title in titles"><a href="#" v-on:click.prevent="select(title)">{{title}}</a></li> | |
| </ul> | |
| <div class=""> | |
| <slot :name="tab" v-for="tab in tabs" v-if="tabSelected === tab"></slot> | |
| </div> | |
| </div> | |
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .noUi-target, | |
| .noUi-target * { | |
| -webkit-touch-callout: none; | |
| -webkit-user-select: none; | |
| -ms-touch-action: none; | |
| touch-action: none; | |
| -ms-user-select: none; | |
| -moz-user-select: none; | |
| user-select: none; | |
| -moz-box-sizing: border-box; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .directive('otInputNcm', ['dialogService', function (dialog) { | |
| return { | |
| link: function postLink(scope, element, attrs) { | |
| element.bind('keydown', function(e){ | |
| if(e.keyCode === 40){ | |
| setFocoBaixo(attrs); | |
| }else if(e.keyCode === 38){ | |
| setFocoCima(attrs); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // No service vc faz isso | |
| getUsers(userId, latitude, longitude){ | |
| return this.http.get(this.ip + 'users/' + userId + '/' + latitude + '/' + longitude).map(res => res.json()); | |
| } | |
| //No component | |
| this.seuService.getUsers(variavel, variavel1, variavel2).subscribe(data => { | |
| console.log(data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('seuModulo') | |
| .factory('httpInterceptor', ['$q', '$location', 'InterceptorErrorMessages', '$rootScope', function($q, $location, InterceptorErrorMessages, $rootScope){ | |
| return { | |
| 'request': function(config){ | |
| return config || $q.when(config); | |
| }, | |
| 'responseError': function(rejection) { | |
| return $q.reject(InterceptorErrorMessages.filterRejection(rejection)); | |
| }, | |
| 'response': function(response) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*Isso pode ser em um servicee*/ | |
| this.treatingDownloadException = function (err, callback) { | |
| var reader = new FileReader(); | |
| reader.onloadend = function () { | |
| callback(JSON.parse(reader.result)); | |
| }; | |
| reader.readAsText(err); | |
| }; | |
| /* Exemplo de chamada http*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ion-header-bar class="bar-light bar-subheader" style="padding-top:52px"> | |
| <form name="frmPesquisa" ng-submit="pesquisar()"> | |
| <div class="list"> | |
| <div class="item item-input-inset" style="background-color: #886AEA"> | |
| <label class="item-input-wrapper"> | |
| <input type="text" placeholder="Número ou Nome..." required="required" ng-model="search.query"> | |
| </label> | |
| <button type="submit" class="button button-clear button-energized" ng-disabled="frmPesquisa.$invalod"> | |
| <strong><i class="ion-ios-search"></i></strong> | |
| </button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(){ | |
| var app = angular.module('myApp', []); | |
| app.controller('MyFamilia', function(){ | |
| var familia = [ | |
| {nome: 'Maria', idade: 53}, | |
| {nome: 'Mario', idade: 12}, | |
| {nome: 'Fulano', idade: 10} | |
| ]; | |
| this.familias = familia; |
NewerOlder