Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228529 articles
Browse latest View live

Urgente¡¡¡ Error en ionic : 'Cannot find module '../pages/users/users'.'

$
0
0

Solo hace falta un espacio entre ion-button y (click) ya que el interprete los reconoce como si fuera un mismo atributo de la etiqueta button, lo cual es incorrecto, por eso el error


Offline first Mobile App with firebase

$
0
0

Well actually I didn't do much with Feathers, however I still think it's a very interesting technology which has the potential to create elegant application solutions. The idea is a little bit like Meteor but more lightweight and flexible, it does not dominate your application architecture as much as Meteor does.

There's a group of very smart people behind the framework who are investing a lot in it and keep improving it:

https://blog.feathersjs.com/june-2017-feathersjs-community-update-e8d98c899b9c

They also have an "offline first" solution now:
https://docs.feathersjs.com/guides/offline-first/readme.html

I think that Feathers is interesting if you want to build a full backend yourself, with business logic/processing and so on, so not just the data storage and authentication that Firebase provides.

If you are looking for a simpler solution (Feathers does have a learning curve and requires you to embrace their approach to application architecture) then have a look at this thread:

This is quite a brilliant post. The essence of it is: build a centralized component that mediates between your app and Firebase.

So instead of scattering Firebase calls all over your application code, mixing your business logic with Firebase specific code, you have your application code (business logic) communicate only with this centralized component, which then communicates with Firebase.

This centralized component can then also take care of "offline" (caching), as the author of the post explains. This makes the whole process transparent, and if ever you want to replace Firebase with something else you can do so relatively easily, if you've done it right - you would only need to rewrite your "mediator" component, not the rest of your app, because the mediator component isolates your app from Firebase specifics.

Some other comments on this same thread pointed out that standard solutions for this problem exist already. So instead of writing this "mediator" component yourself you can use these standard solutions, the most well-known is called "ngRX" which is based on "RxJS".

In general, I am more a fan of this type of application-level solution (either Feathers or ngRx or a home-grown mediator component) than a "black box auto-magic" solution at the database level (for instance with Couchbase remote/local or Pouchbase).

These database level solutions sound easy, but you don't have any control over what's going on - way too much "magic" (which is fine as long as there are no problems but becomes a liability when it doesn't work).

Looking for a way to measure distance for workout app

$
0
0

I'm not sure if it's what you're after but you could try the geolocation plugin. Just take their start location and calculate the distance travelled between their current location.

A traditional way of launching an app

Not reciveing my bluetooth device

$
0
0

ive been trying to use the scan function of the BLE plugin. how ever while thought it apparently does scan im not receiving any data. i tried connecting it directly but that's not working either.

i am trying to connect to a bluetooth module if that helps.

please help. there is so little support about Bluetooth on ionic. the documents are not too useful.

home.ts

import { Component } from '@angular/core';
import { BluetoothSerial } from 'ionic-native';
import { NavController } from 'ionic-angular';
import { AlertController } from 'ionic-angular';
import { BLE } from '@ionic-native/ble';
import { Platform } from 'ionic-angular';
import { AndroidPermissions } from '@ionic-native/android-permissions';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'

})
export class HomePage {
  scanning: boolean = false;
  data: any[] = [];
  permissions: any[] = ["BLUETOOTH", "BLUETOOTH_ADMIN", "BLUETOOTH_PRIVILEGED"];

constructor(platform: Platform,
            private androidPermissions: AndroidPermissions,
            private ble: BLE,
            public alertCtrl: AlertController,
            public navCtrl: NavController){
              this.ble.isEnabled().then(() => {
                console.log('hurray it bluetooth is on');
            }, (error) => {
                console.log(error);
                  this.ble.enable().then(resp => {
                    console.log("bluetooth is enabled now");
                }, (error) => {
                  console.log('bluetooth was not enabled');
              });
            });
      }

  settings(){
    this.ble.showBluetoothSettings().then((rspo)=>{
      console.log("accesed");
    }, (error) => {
      this.normalAlert("settings error", error);
    })
  }

  connect(){
    this.ble.connect("00:15:83:35:73:CC").subscribe((rspo)=>{
      this.normalAlert("connected to HC-06 device", rspo);
    }, (error) => {
      this.normalAlert("error", error);
    })
  }

    search(){

      this.ble.startScan([]).subscribe(
        rspo => {
          this.scanning = true;
          this.data = rspo.id;
      }, (error) => {
        this.scanning = false;
        let alert = this.alertCtrl.create({
          title: 'devices not found',
          message: error,
          buttons: ['ok']
        });
        alert.present();
    })
  }

  stop(){
    this.ble.stopScan();
    this.scanning = false;
  }


    discover(){

    }

/*
    BluetoothSerial.isEnabled().then(() => {
      console.log("bluetooth is enabled all G");
    }, () => {
      console.log("bluetooth is not enabled trying to enable it");
          BluetoothSerial.enable().then(() => {
              console.log("bluetooth got enabled hurray");
                }, () => {
                  console.log("user did not enabled");
          })
    });
}

 search(){
    BluetoothSerial.list().then((data) => {
        JSON.stringify( data );
        console.log("hurray" + data);
        this.showDevices("Found Devices", data.id, data.class, data.address, data.name);
      },
      (error) => {
      console.log("could not find paired devices because: " + error);
      this.showError(error);
    });
  }

  discover(){
    BluetoothSerial.discoverUnpaired().then ((device) => {
          BluetoothSerial.setDeviceDiscoveredListener().subscribe( (device) => {
            JSON.stringify( device );
            this.infomation = {id: device.id};
            this.showDevices("Unparied devices", device.id,device.class,device.address,device.name);
            console.log(device.id);

      });
  },
      (error) => {
        this.showError(error);
        console.log("could not find unparied devices " + error);
  });
}
*/


  normalAlert(title:string, message:string) {
    let alert = this.alertCtrl.create({
      title: title,
      message: message,
      buttons: ['OK']
    });
    alert.present();
  }
}

home.html

<ion-header>
  <ion-navbar>
    <ion-title>
      Bluetooth Light control
    </ion-title>
  </ion-navbar>
</ion-header>

<ion-content padding>
    <button ion-button (click) = "settings()">bluetooth settings</button>
    <button ion-button (click) = "connect()">connect to hc-06</button>
    <button ion-button (click) = "search()">start scan</button>
    <button ion-button (click) = "stop()">stop scan</button>

    <p>
      scaning: {{scanning}}<br>
      here is a list of id's...
    </p>

    <ion-list>
      <ion-item *ngFor="let device of data">
        {{device.id | json}}
      </ion-item>
    </ion-list>

Urgente¡¡¡ Error en ionic : 'Cannot find module '../pages/users/users'.'

$
0
0

muchas gracia dieon10 sin embargo me cambio el error al dar click en el boton "usuarios y al intentar pasar a la siguiente pagina me aparece ahora el siguiente error

a pesar que en home.ts esta de manera correcta o eso creo

Urgente¡¡¡ Error en ionic : 'Cannot find module '../pages/users/users'.'

$
0
0

ya funciona muchas gracias efectivamente ese era el error un espacio muchas gracias

Urgente¡¡¡ Error en ionic : 'Cannot find module '../pages/users/users'.'

$
0
0

Es comun que tarde un poco el asociar funciones del typescript con el html, siempre que falle intenta antes recargar el navegador unas cuantas veces, si el codigo de error es el mismo, entonces si hay algo mal.

Saludos!


White screen crosswalk-webview android 7

$
0
0

I think that crosswalk if better for old android systems. Currently I am using it for API < 21 and everything else does not use it.

Urgente¡¡¡ Error en ionic : 'Cannot find module '../pages/users/users'.'

$
0
0

if you using ionic 3 hint the-> import { UsersPage } from '../users/users';
instead of
import { UsersPage } from '../pages/users/users';

Ionic PWA to access mobile camera

$
0
0

Thanks , can i use Cordova in Ionic PWA?

Ionic Native Google Maps api

$
0
0

The fit bounds mechanism can be implemented with the camera options,

export class FitBounds {
  markers;
  @ViewChild('map') mapTag: ElementRef;
  map: GoogleMap;
  bounds: LatLng[] = [];

  constructor(public navCtrl: NavController, public navParams: NavParams, private googleMaps: GoogleMaps,
              private properties: PropertiesProvider) {
    this.markers = properties.getProperties(); //where I get the lat and lng from
  }

  ionViewDidEnter() {
    this.loadMap();
  }

  ionViewWillLeave(){
    if(!this.map){
      this.map.remove();
    }
  }

  loadMap() {
    if(this.map){
      this.map.clear();
    }
    this.map = this.googleMaps.create(this.mapTag.nativeElement);
    // listen to MAP_READY event
    // You must wait for this event to fire before adding something to the map or modifying it in anyway
    this.map.one(GoogleMapsEvent.MAP_READY).then(() => {
      let self = this;
      this.map.clear();
      this.markers.forEach((a)=>{
        let tmp = new LatLng(a.address.location.lat, a.address.location.lng);
        self.addMarker(tmp);
        self.addlatlngBound(tmp);
      });
      let latlngBounds = new LatLngBounds(self.bounds);
      self.moveToPosition(latlngBounds);
    });
  }

  moveToPosition(latlng: LatLngBounds){
    let self = this;
    let position: AnimateCameraOptions = {
      target: latlng,
      tilt: 0,
      duration: 1000
    };
    self.map.animateCamera(position);
  }

  addMarker(latlng){
    let self = this;
    let marker: MarkerOptions ={
      position: latlng
    };
    self.map.addMarker(marker).then(function (marker: Marker) {
      marker.showInfoWindow();
    });
  }

  addlatlngBound(latlng: LatLng){
    this.bounds.push(latlng);
  }
}

Issue in using custom Cordova plugin with Ionic app

PositionError while using geolocation plugin on android device

$
0
0

Hi,

I am using ionic native plugin cordova-plugin-geolocation in my app for retrieving device's current location. Below is my approach after installing plugin-

import { Geolocation } from '@ionic-native/geolocation';
constructor(private geolocation: Geolocation) {}
this.geolocation.getCurrentPosition().then((resp) => {
// resp.coords.latitude
// resp.coords.longitude
}).catch((error) => {
console.log('Error getting location', error);
});

I am able to retrieve co-ordinates on iOS and browser. But it is not working on android device which is returning "object PositionError". It used to work earlier on android device also. Suddenly I am getting this error. Could some one please help me in getting this resolved?

Thanks,
svvrls

Hiding and (showing) the list of items in the card

$
0
0

hi to all,
i new to ionic.
i want to create a card with card header and it has list of items,
When i clicked on card header it shows the list of the items. else it should hidden.
Help me how to create this,,,,,,,,,,,,,,


Hiding and (showing) the list of items in the card

GET request with nested JSON object

$
0
0

Hi,

When performing a GET request with a nested JSON parameter, its value is being serialised into a string, which then needs to be parsed in the Rails backend:

Started GET "/api/data/index.json?query=%7B%22term%22:%22abc%22,%22paginated%22:true%7D" for ::1 at 2017-07-07 14:56:29 +1000
Processing by Api::DataController#index as JSON
  Parameters: {"query"=>"{\"term\":\"abc\",\"paginated\":true}", "datum"=>{}}

Is there a way to serialise the request like a POST? What I wanted is what a browser does when submitting the same URL (http://localhost:3000/api/data/index?query={term:'abc',paginated:true}). The server receives a hash instead of a string:

Started GET "/api/data/index?query={term:'abc',paginated:true}" for ::1 at 2017-07-07 15:00:44 +1000
Processing by Api::DataController#index as HTML
  Parameters: {"query"=>"{term:'abc',paginated:true}"}

Googling this subject I found that Angular.js previously offered an alternative serializer, $httpParamSerializerJQLike, but that doesn't seem to be the case for Angular2 anymore? Also, I couldn't figure how this could be used in Ionic, as the Http object is injected and there's no documentation on how to configure it?

Any help on the subject is appreciated...

Thanks, Ricardo

GET request with nested JSON object

$
0
0

There is a standard syntax for URL query strings used across the web. Why don't you want to use it?

/api/whatever?term=abc&paginated=true

Ionic CLI Verifying each time my libraries version

$
0
0

Is there any way to bypass the initial ionic latest version verification? I am waiting 1 minute sometimes when I want to recompile my code because of this.
I want to start directly with webpack.

Freelance app developer, UK-SPAIN Stablished Startup

$
0
0

Hi! I'm an experienced ionic 2/3 - hybrid iOS and Android mobile app developer. My github profile is - https://github.com/divyanshuchat
I would be happy to assist in your ionic app development. My skype is divyanshu_chaturvedi

I am familiar with Ionic 2,3 Framework, AngularJS, API JSON data integration and other native features like Push Notifications using ionic cloud and one signal (although I prefer ionic cloud the most). I've used ionic cloud for deploying apps for real time testing on android and iOS devices, GitHub for code sharing and change management, AWS for server-side API/code hosting and Xcode/Android studio for iOS and android app builds, releases and publishing to stores. My experience and through my previous gigs I've possessed the capacity to create applications with usefulness like client signup and information exchange database, login, social login utilizing facebook, twitter, geo-location and social sharing, messaging apps, user profile etc. and many different components relying upon client the prerequisites. Also experienced in google maps API, geo-location, geo-fencing and other google api features. I have broad involvement in making backend taking into account PHP, REST, NodeJS and JSON based APIs required to speak with the application.

I would facilitate adoration to start a correspondence and talk about the project requirements further.

Thanks
Divyanshu Chaturvedi

Viewing all 228529 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>