Posts by Fernando Fabreti • 421 points
27 posts
-
2
votes1
answer1166
viewsA: Difficulty navigating between views using Ionic Framework
If you’re using the ui-router, wherever you are, research $state and use the . go function() Example: angular.module('App', [ 'ionic',...]) .run(function($state) { if ( ... ) { $state.go('pag1');…
-
1
votes1
answer1323
viewsA: Calculate Distance between markers
Easy. Try on the Chrome console: /* Retorna distancia em metros */ var haversine = function(lat1, lon1, lat2, lon2) { var deg2rad = 0.017453292519943295; // === Math.PI / 180 var cos = Math.cos;…
-
0
votes1
answer102
viewsA: Best way to read Angularjs in an Ionic app
It’s not "on the route" that you do the localStorage check, it’s in her controller. See, you’re running a code that doesn’t belong to the controller in question. It would be better to define which…
-
0
votes2
answers75
viewsA: How to pass an Array to the IN clause of a flat query?
You are not using Activerecord. You are sending SQL commands in a direct connection to the BD. If you want to use the abstraction that Activerecord provides: class Publication <…
-
1
votes1
answer240
viewsA: Uncaught Referenceerror: Ionic is not defined
Set the service in the following places: in the command line, add the Webclient platform and the plugin $ ionic add ionic-platform-web-client $ ionic plugin add phonegap-plugin-push --variable…
-
0
votes2
answers1418
viewsA: Redirect to External Link
If you don’t have the plugin inAppBrowser installed, the external page opens in the app’s own webview. inAppBrowser replaces windows open and you can choose to open in another webview (_Blank) or…
-
0
votes2
answers182
viewsA: When you do not write anything, do not appear "Type a name"
Friend, Ionic (better, Angularjs!) values not changing the DOM via controller. My suggestion is that you control placeholders or filenames via scope variables. Below follows an example of a select…
-
1
votes1
answer256
viewsA: Front page - Ionic and ui-router
You’ve already set up, just edit the template files. You should put the template files in the directory www. In his example, /minhaApp/www/templates/tab-dados.html…
-
1
votes1
answer132
viewsA: Basic Auth with Ionic and Angularjs?
Try this: $http.get('http://myserver.com/api', { headers: {'Authorization': 'Basic '+ base64.encode( username + ':' + password) } }) debug in Chrome Developer-Tools, Network tab…
-
0
votes2
answers1770
viewsA: Object filter disregarding accents in Angularjs with Ionic
Colleague, use this solution below: simpler and sets the filters globally: angular.module('App', [ 'ionic']) .filter('removeAccents', function removeAccents() { return function (source) { var accent…
-
0
votes2
answers813
viewsA: $http works on browser and not android device
Colleague, manage a debug apk ( ionic run android ) and plug your phone via USB enabling the modo de depuração USB on your device. Then open the Chrome console on developers tools and debug the app.…
-
1
votes1
answer3161
viewsA: Synchronize Local Database from Remote Server on IONIC
Old question, but I hope that this answer will serve the other Googlers. I’ll give you an example of how to do it. (untested code!) Create the Factory below: it stores your contacts in memory, in…
-
0
votes3
answers895
viewsA: Side menu in Angular
You quoted Ionic, but you didn’t put the Ionic tag on the question. Assuming you are using Ionic, the best way is to use a sidemenu tarter: ionic start myApp sidemenu afterward ionic serve you can…
-
0
votes2
answers25433
viewsA: Disable Access-Control-Allow-Origin in Chrome and Firefox
It’s not just setar headers in the backend. The Web client must define what to accept as well. In development environment, you can work around the problem (disabling CORS checks in the browser) or…
-
0
votes2
answers332
viewsA: Multiple Views with Angularjs and Ionic
Simple. You navigate between States with ui-sref='myState' Try: <button class="button button-block button-viceri-C"> Vendas <i class="ion-ios-pie-outline" style="font-size:…
-
2
votes2
answers556
viewsA: How to change the value of an input by a Factory?
Colleague, you are addressing the problem without taking into account the philosophy of Angularjs which is to change the DOM only through directives. A Factory should not alter the DOM. A controller…
-
1
votes4
answers541
viewsA: Navigate through screens carrying information
I don’t recommend using Jquery with Ionic: the philosophy of jquery is to manipulate the DOM directly, which goes against the philosophy of the Angularjs that manipulates the DOM through directives.…
-
0
votes1
answer2233
viewsA: Open pages in content?
The Ionic uses the ui-router to navigate between States. States are usually composed of a view (html template) and a controller (js). There are several ways to navigate between Tates, for example…
ionicanswered Fernando Fabreti 421 -
1
votes1
answer8587
viewsA: Testing app locally in the browser?
You bypassed the security of the app and backend by disabling CORS. To configure CORS on client and server (in development environment) I do this: index.html: <meta…
-
0
votes1
answer214
viewsA: Send data to another tab through the "ion-option-button"?
I have done this before passing parameters on Urls, but experience has shown me that it is better to assemble a Factory and record the data there. It gets more organized and centralized. But it also…
-
0
votes2
answers659
viewsA: Problem when trying to get $Scope of form with Ionic
Your problem seems to be the modal creating a new Cope. The correct one would be to debug in Chrome, set breakpoints and analyze the variable $Scope and such. Since you set the modal Scope, you can…
-
0
votes1
answer42
viewsA: Using stateparams is not returning json to display in detail
See my answer in: /a/100066/8386 Try: $http.get("../templates/teste.json").success(function (response) { $scope.x = response; if (!$scope.$$phase) $scope.$apply(); });…
-
1
votes1
answer2051
viewsA: How to call another html file in Ionic?
In fact, you want to navigate between views: 1) define your routes (see this example) 2) Define your controllers 3) use ui-sref= instead of href=…
-
1
votes1
answer508
viewsA: Show Local Database data on screen, Ionic
Take a look at my answer on: /a/100066/8386 You need to let Angular know that the data has changed. This happens automatically in some predefined cases, such as when using Models (the Angular…
-
1
votes1
answer367
viewsA: Data Binding does not work after calling function
Tips: 1) You must understand the Angular Digest cycle; 2) You should call this function somewhere (you didn’t detail it in the question) either by clicking a button or as code in the controller; 3)…
-
3
votes5
answers2123
viewsA: How to validate CIS in ruby?
So, here it goes: def validaCEI(num) num = num.gsub(/\D+/,'') #só digitos return false if num.size!=12 x = [] numDV = num[-1].to_i num = num.chop #remove digito verificador…
-
3
votes5
answers2123
viewsQ: How to validate CIS in ruby?
To validate CPF and CNPJ I use 'brcpfcnpj' in Gemfile. But I couldn’t find anything to validate the CIS. Validating INSS Specific Registration in Ruby on Rails ?