Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 70844 articles
Browse latest View live

0x800a1391 - JavaScript runtime error: 'angular' is undefined

$
0
0

@davidpob99 wrote:

When I try to deploy the app that I created with Ionic Framework 1.3.1 into a Windows 10 PC with Visual Studio 2015, I had this error:

Unhandled exception at line 8, column 1 in ms-appx-web://com.ionicframework.contadormus577700/www/js/app.js

0x800a1391 - JavaScript runtime error: 'angular' is undefined

The code of the app.js is:

// Ionic Starter App

// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('app', ['ionic', 'app.controllers', 'app.routes', 'app.directives','app.services',])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
      cordova.plugins.Keyboard.disableScroll(true);
    }
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
    }
  });
})

index.html:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title></title>

    <script src="lib/ionic/js/ionic.bundle.js"></script>


    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.css" rel="stylesheet">
    -->


    <link href="lib/ionic/css/ionic.css" rel="stylesheet">


    <style type="text/css">
      .platform-ios .manual-ios-statusbar-padding{
        padding-top:20px;
      }
      .manual-remove-top-padding{
        padding-top:0px;
      }
      .manual-remove-top-padding .scroll{
        padding-top:0px !important;
      }
      ion-list.manual-list-fullwidth div.list, .list.card.manual-card-fullwidth {
        margin-left:-10px;
        margin-right:-10px;
      }
      ion-list.manual-list-fullwidth div.list > .item, .list.card.manual-card-fullwidth > .item {
        border-radius:0px;
        border-left:0px;
        border-right: 0px;
      }
    </style>

    <script src="js/app.js"></script>
    <script src="js/controllers.js"></script>
    <script src="js/routes.js"></script>


    <script src="js/directives.js"></script>

    <script src="js/services.js"></script>


    <!-- Only required for Tab projects w/ pages in multiple tabs
    <script src="lib/ionicuirouter/ionicUIRouter.js"></script>
    -->

  </head>
  <body ng-app="app" animation="slide-left-right-ios7">
  <div style="">
    <div style="">
        <ion-nav-bar class="bar-stable">
            <ion-nav-back-button class="button-icon icon ion-ios-arrow-back">Back</ion-nav-back-button>
        </ion-nav-bar>
        <ion-nav-view></ion-nav-view>
    </div>
</div>
  </body>
</html>

I tried to solve the problem with this page but the error continues: Ionic Visual Studio 2015 template get 'Angular is undefined' error when trying to start in debug for Windows

Anybody have any ideas why this does not work?

Thanks in advance

Posts: 2

Participants: 2

Read full topic


How to include highcharts.js in ionic 2?

$
0
0

@sergiosanabria wrote:

I could include the basic libraries HighCharts.js but not additional. That is, Highcharts-more.js. Someone could do that?

Posts: 1

Participants: 1

Read full topic

How to trigger the same action as an tag click from controller in ionic?

$
0
0

@gbas wrote:

I m using a widget called tabbedSlideBox and my view looks like this

By pressing each icon with my finger it triggers a series of events e.g change slide,make tab active etc. How can I imitate this action from my controller ? Every icon is in form of :

<a href="javascript:;" id="action1-tab">Action 1</a>

I tried to get element with JavaScript and then trigger click but nothing happens

var a=document.getElementById("#action1-tab");
a.click();

Any ideas?

Posts: 1

Participants: 1

Read full topic

Ionic Breaking Header When Acessing State Directly

$
0
0

@leonardollobato wrote:

Here's the thing, in the first version my application display on screen a list of payment devices, when the user clicks in one of them another screen is displayed with the transactions processed by that device.

but the workflow has changed, now I go directly to the transactions screen and then filter the payment devices by the dropdown above (in the picture).

It's working fine, the only problem is that when I access the Transactions Screen Directly, the header breaks! just when I access directly, if I access the payments device screen first and then access the transactions screen its layouts work perfectly.

I know the question is a little bit 'open' but I can't find why this is happening, any suggestions would be a great help.


this code is placed on the run area at my app.module

this is the transactions screen

this is the template used.

thanks in advance.

Posts: 1

Participants: 1

Read full topic

Ionic slideBox content of other slide appears on current slide at bottom

$
0
0

@sjerd wrote:

Hey, so i've got some strange behaviour in the slidebox. It appears as if the next slide is loaded below the current slide before transitioning to the next slide. I'm trying to fix it with some dirty css height:100% fix but this is not how it should work and it isn't working.

does someone have this problem/bug and did you find a fix yet?

Posts: 1

Participants: 1

Read full topic

How to do Ion-slide with ion-checkbox from database

$
0
0

@amrayoub wrote:

hello , i'm trying to do Ion-slide with ion-checkbox from database.
like when i choose couple of items and click submit ,it show them on ion slider after each other

<ion-view title="Compare Models" id="page10" class=" ">
<ion-content padding="true" class="has-header" >
<div class="spacer" style="width: 285px; height: 21px;"></div>
<p id="compareModels-markdown4" style="color:#797979;font-size:16px;text-align:center;" class=" ">Select two or more models to compare their specifications.</p>
<form id="compareModels-form3" class="list ">
<label class="item item-input" >
<i class="icon ion-search placeholder-icon"></i>
<input type="search" ng-model="query" class="" placeholder="Search Models..." />
</label>
<ion-list>
<ion-item >
<ion-checkbox ng-repeat="model in models | filter:query" >{{model.model_number}}</ion-checkbox>
</ion-item>
</ion-list>
<button class= button button-royal button-block ">Compare Selected</button>
</form>
</ion-content>
</ion-view>

.controller('compareModelsCtrl',['$scope','$http', '$state' ,
function($scope, $http, $state,$location) {
    $http.get('js/data.json').success(function(data){
        $scope.models =  data;
        $scope.whichmodel = $state.params.modelId;
        //$scope.toggleStar = function(model){
        //    model.star = !model.star;
        //}



    });

}])

any idea how that can be done ?

Thanks

Posts: 1

Participants: 1

Read full topic

navParam caching issue / ionViewLoaded db re-load issue?

$
0
0

@UrbanCondor wrote:

I'm having trouble with an Ionic 2 App I am working on - It appears as though it's a caching issue, but I can't figure out why it is occurring. I think perhaps the navParam data I am pushing to a page is persisting when I pop the page off again? Below is a detailed explanation of what I'm experiencing - I would appreciate any input / advice / code critiques.

GroceryApp
The GroceryApp consists of the following components:
* HomePage - Lists Grocery Stores. Enables a user to delete existing stores.
* DetailsPage - Acts as the "Create Grocery Store" and "Edit Grocery Store" page, depending on how the user navigated to the page. Enables a user to Enter / Modify Grocery Store Information, and also to View / Delete from a list of store products (each store can have zero, one or more products).
* ProductModal - Acts as the "Create Grocery Store Product" and "Edit Grocery Store Product" modal, depending on how the user navigated to the modal. Enables the user to Enter / Modify Grocy Store Product Information.
* GroceryDataProvider - Contains all required details for syncing PouchDB to Cloudant. I based this on the provider found in this tutorial, except it uses cloudant instead of CouchDB.

Sample Screenshots

Database Structure
I'm using a very basic JSON document structure:
{
"_id": "471B10E6-2F4E-3663-8765-44176EAD5343",
"_rev": "1-7fcd259cb670ef3457278ec1b42c5574",
"g_store_name": "Store A",
"g_store_description": "A very nice store",
"g_store_products": [
{
"product_id": "0",
"product_name": "Apple",
"product_description": "Crispy",
"product_price": "100"
},
{
"product_id": "1",
"product_name": "Banana",
"product_description": "Ripe",
"product_price": "150"
},
{
"product_id": "2",
"product_name": "Pear",
"product_description": "Rotten",
"product_price": "50"
}
]
}

The Issue
I'm having an issue maintaining and displaying the GroceryStoreProduct Array. When a user is on the DetailsPage, I want them to be able to add / edit / delete as many GroceryProducts as they wish, however I don't want anything to be saved to the database until they hit the SUMIT button. Also, if the user hits the CANCEL button then I want the GroceryStoreProduct Array to return to its original state before the user entered the DetailsPage, i.e. a reflection of what is written in the database.

Everything works fine on SUBMIT. All new product are added to the database and any removed products are removed.

However, when the user hits CANCEL, I'm having no such luck. For example, if I Edit "Store A" and delete the "Banana" product, then click CANCEL, the HomePage is displayed however it lists "Store A" as having "Apple" & "Pear" products, but no "Banana". Opening the DetailsPage will reflect the same results, whereby only "Apple" & "Pear" products are listed. However checking the database will reveal that the "Banana" product still exists in the "Store A" g_store_products array.

I have been searching the Internet for clues as to what the problem may be, but no such luck yet. I thought maybe I needed to re-load the DB values using the ionViewLoaded function on the DetailsPage, but I can't work out how (or if I need to). Any input would be greatly appreciated.

The GroceryApp project can be found on GitHub here. You'll need to add your own cloudant connection information to the grocery-data.ts file to get it to work.

Posts: 1

Participants: 1

Read full topic

Touchmove event requested to be made passive

$
0
0

@r123456789 wrote:

Have an Ionic 1 app. Using swipe left/right. They work.

However in the Chrome debugger the below error message is occasionally displayed:

Handling of 'touchmove' input event was delayed for 128 ms due to main thread being busy. Consider marking event handler as 'passive' to make the page more responsive.

Cannot find in searching Ionic and Angular a solution to this issue. i.e. an example of how to make in an Ionic app the event handler passive.

If anyone can reference an Ionic example or suggest a solution it would be appreciated. Thanks in advance.

Posts: 1

Participants: 1

Read full topic


Dynamic Custom Component - Alert Overlay - NavController getActive Error

$
0
0

@savvior_duncan wrote:

Hello,

Adding a component dynamically using createComponent similar to:

I have a button in my component which should throw up an alert, so this should not involve the lifetime cycle:
let alert = this.alertController.create({
title: 'Profile Edit',
subTitle: 'Show Edit Profile Overlay',
buttons: ['OK']
});
alert.present();

am getting an error of:
EXCEPTION: TypeError: activeNav.getActive is not a function

I've tried adding IONIC_DIRECTIVES to my dynamic component directives. I am injecting the NavController and AlertController into the constructor.

I just feel like I'm missing something simple, maybe not though.

Do i need to insert my component into the navcontroller somehow after it's been created? Is there a simple way to do that w/o pushing it on to the stack with default transitions? This component isn't really a page, so to speak, more of an overlay, similar to a modal but a bit more complex.

Thanks.

Posts: 3

Participants: 2

Read full topic

Do I need one specific security profile for each app at ionic.io?

$
0
0

@devwplex wrote:

I use Linux to develop and I want to explore the build / package feature to iOS and Android at ionic.io platform.

I'll provide a white label solution for our customers, I've one source code and with a few changes I'm able to configure a new customized app (logo, name, data, etc).

So I've a question about how to organize my apps and security profiles at ionic.io. Do I need one security profile for "customer-one app" and another one security profile for "customer-two app" or am I able to use just one security profile for both "customer-one app" and "customer-two app"?

Thank you.

Posts: 1

Participants: 1

Read full topic

Update content on Loading component: display percentage?

$
0
0

@mikewagz wrote:

Is there a way to dynamically update the loading component's content after it has been displayed? I see a "setContent" function here:

But it does not seem to display. Thanks!

Posts: 2

Participants: 1

Read full topic

How to use ion-fixed

Audio not working on device?

$
0
0

@jacklu wrote:

I added an audio element in index.html. It works fine with ionic serve but not working on my phone.
Is audio supported in WebView?

Posts: 1

Participants: 1

Read full topic

[b11] Modal fails to dismiss when nav.pop or nav.popToRoot fires (with plunkr)

$
0
0

@kstile wrote:

I have a timer set to destroy log the user off, and push the login page.
Previously, I pop'd to root, and pushed the page, however in b11, if a Modal is displayed, the pop works, but the Modal is not dismissed.

This seems contrary to the documentation.

When a modal (or any other overlay such as an alert or actionsheet) is "presented" to a nav controller, the overlay is added to the app's root nav. After the modal has been presented, from within the component instance The modal can later be closed or "dismissed" by using the ViewController's dismiss method. Additionally, you can dismiss any overlay by using pop on the root nav controller.

replicated in a plunker. after 1 second of hitting the button, I expect the pop call would close the modal.

http://embed.plnkr.co/aDOOTJJeHjB1pElSq4un/

Posts: 1

Participants: 1

Read full topic

View not updating after API call following login

$
0
0

@tiansivive wrote:

Hey folks,

I've started experimenting with ionic2. I built a simple app, with navigation between pages, several layouts, menu etc. I hooked everything up and used the http module to get data for the views from an API.
I then added a login page as the rootview. After successfully logging in I set my root to my homepage.
The authentication works, so does the app and the API calls. Everything together does not.

I'm using authentication via Facebook. I use the InAppBrowser plugin to achieve this as my API was already set up to do the whole oAuth redirect dance. The API correctly creates a session and sends back a token which I then strip out of the URL and store locally. After that I close the inAppBrowser and set the root page. That page request more data from the API and successfully updates the model, yet the view remain blank.
I tested this without the login page, setting the homepage as root directly and that works, but when I try to use with the login first, it doesn't update.

Anyone have any ideas on the reason for this?

Posts: 1

Participants: 1

Read full topic


Windows 10 - TypeError: Object doesn't support property or method 'openDatabase'

$
0
0

@jgeegj wrote:

When using the SqlStorage plugin for windows I get this error:
-- TypeError: Object doesn't support property or method 'openDatabase'

I tried installing the plugin cordova-sqlite-ext, but the error remains. What can I do to resolve this issue?

Posts: 1

Participants: 1

Read full topic

Problem in popToRoot()

$
0
0

@varshil29 wrote:

i implement logout functionalitry and in that i set nav.popToRoot() nut when user click on logout button they didn't redirect to login screen.

code that i used

static doLogout(service:WebService,alertCtrl:AlertController,nav:NavController)
    {

        try{
            service.logout().map(res => res.text()).subscribe(
                data => {
                    AllFunctions.closeLoading();
                      nav.popToRoot();
                    });
          }catch(error)
          {
            AllFunctions.doAlert(Constants.error + '- 471',alertCtrl);
          }
    }

call above function when pressed logout button

Posts: 1

Participants: 1

Read full topic

Ionic 2 Chat

$
0
0

@richardmarais wrote:

Hi All,

I am trying to create a chat app.

I have a Java Server and Ionic 2 Client.

I get the following error:

ORIGINAL EXCEPTION: ReferenceError: io is not defined

Any suggestions please?

Thanks


I have the following code so far:

CLIENT
ts

import { Component, NgZone } from '@angular/core';
import { Http } from "@angular/http";
declare var io;
//require ('io');

@Component({
  templateUrl: 'build/pages/chat/chat.html',
})

export class ChatPage {

  private socketHost: string = "http://localhost:3700";
  private messages: string[] = [];
  private zone: NgZone = null;
  private chatBox: string = null;
  private socket: any = null;

  constructor(http: Http) {
    this.messages = [];
    this.zone = new NgZone({ enableLongStackTrace: false });
    //let url = this.socketHost + "/fetch";
    let url = this.socketHost;
    http.get(url).subscribe((success) => {
      var data = success.json();
      for (var i = 0; i < data.length; i++) {
        this.messages.push(data[i].message);
      }
    }, (error) => {
      console.log(JSON.stringify(error));
    });
    this.chatBox = "";


    this.socket = io(this.socketHost);
    this.socket.on("chat_message", (msg) => {
      this.zone.run(() => {
        this.messages.push(msg);
      });
    });
  }

  send(message) {
    if (message && message != "") {
      this.socket.emit("chat_message", message);
    }
    this.chatBox = "";
  }
}

html

<ion-navbar *navbar>
    <ion-title>
        Chat
    </ion-title>
</ion-navbar>

<ion-content class="home">
    <ion-list>
        <ion-item *ngFor="let message of messages">{{message}}</ion-item>
    </ion-list>
</ion-content>

<ion-footer-bar>
    <ion-input>
        <input type="text" [(ngModel)]="chatBox" placeholder="Message..." />
        <button (click)="send(chatBox)">Send</button>
    </ion-input>
</ion-footer-bar>

index.html

<script src="/socket.io/socket.io.js"></script>

SERVER
Java

import com.corundumstudio.socketio.AckRequest;
import com.corundumstudio.socketio.Configuration;
import com.corundumstudio.socketio.SocketIOClient;
import com.corundumstudio.socketio.SocketIOServer;
import com.corundumstudio.socketio.listener.ConnectListener;
import com.corundumstudio.socketio.listener.DataListener;
import com.corundumstudio.socketio.listener.DisconnectListener;

public class Server {

    public static void main(String[] args) {
        Configuration config = new Configuration();
        config.setHostname("localhost");
        config.setPort(3700);
        final SocketIOServer server = new SocketIOServer(config);
        server.addConnectListener(new ConnectListener() {
            @Override
            public void onConnect(SocketIOClient client) {
                System.out.println("onConnected");
                client.sendEvent("message", new Message("", "Welcome to the chat!"));
            }
        });
        server.addDisconnectListener(new DisconnectListener() {
            @Override
            public void onDisconnect(SocketIOClient client) {
                System.out.println("onDisconnected");
            }
        });
        server.addEventListener("send", Message.class, new DataListener<Message>() {

            @Override
            public void onData(SocketIOClient client, Message data, AckRequest ackSender) throws Exception {
                System.out.println("onSend: " + data.toString());
                server.getBroadcastOperations().sendEvent("message", data);
            }
        });
        System.out.println("Starting server...");
        server.start();
        System.out.println("Server started");

    }
}

Posts: 2

Participants: 1

Read full topic

Native Zip doesn't work

$
0
0

@julienfle wrote:

Hi,

I can't use the native plugin Zip. The plugins is not recognized .
import { Zip } from 'ionic-native';
Error : "/node_modules/ionic-native/dist/index has no exported member" 'Zip'

I have correctly installed the plugin with : ionic plugin add cordova-plugin-zip.
I have been working with many plugins and this is the only one I have issues with.

Do you have a solution ?

IDE : JetBrains WebStorm
Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.37
Ionic App Lib Version: 2.0.0-beta.20
Node Version: v4.4.5

Thank you.

Julien

Posts: 2

Participants: 2

Read full topic

Toggle in a generated list in ionic

$
0
0

@youssefff wrote:

Hi guys,
I'm new to ionic developpement, I'm trying to load some data into a list,it works well, and i added a toggle in each list,and it works too, but the problem when click on a toggle, all of them become active, heres my code, can any body help me please how to resolve this problem

<div class="item item-divider" >{{key}}</div>
<li class="item item-toggle" ng-repeat="var in value">
  {{var.designation}}:{{var.id}}
  <label class="toggle toggle-positive">
    <input type="checkbox"  ng-model="check.bool" ng-click="check.isActive()">
    <div class="track">
      <div class="handle"></div>
    </div>
  </label>
</li>

Posts: 1

Participants: 1

Read full topic

Viewing all 70844 articles
Browse latest View live


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