Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all 49526 articles
Browse latest View live

Finishing get values from storage then startup the app

$
0
0

@oumaralshamass wrote:

hello
i created provider and inside it 2 methods one of them to store value using “storge” and the another to return this value
the problem i use this returned value to view some data in the pages …and this function that return data sometimes work after page load and sometimes work before and that not correct
what i need is force this the function to return data first and then render the page
how i can do it
with thanks

Posts: 1

Participants: 1

Read full topic


Can't resolve './app.module.ngfactory' is still present

$
0
0

@tilmido wrote:

lets say i read all issue related to this one #1309 & #1315 & #20292 & #13356 and more but i still have the problem

[10:56:42]  webpack started ...
[10:56:43]  copy finished in 13.32 s
Error: ./src/app/main.ts
Module not found: Error: Can't resolve './app.module.ngfactory' in 'C:\Users\developer-1\Downloads\app-sa (2)\src\app'
resolve './app.module.ngfactory' in 'C:\Users\developer-1\Downloads\app-sa (2)\src\app'
  using description file: C:\Users\developer-1\Downloads\app-sa (2)\package.json (relative path: ./src/app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: C:\Users\developer-1\Downloads\app-sa (2)\package.json (relative path: ./src/app)
    using description file: C:\Users\developer-1\Downloads\app-sa (2)\package.json (relative path: ./src/app/app.module.ngfactory)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\developer-1\Downloads\app-sa (2)\src\app\app.module.ngfactory doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\developer-1\Downloads\app-sa (2)\src\app\app.module.ngfactory.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\developer-1\Downloads\app-sa (2)\src\app\app.module.ngfactory.js doesn't exist
      .json
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\developer-1\Downloads\app-sa (2)\src\app\app.module.ngfactory.json doesn't exist
      as directory
        C:\Users\developer-1\Downloads\app-sa (2)\src\app\app.module.ngfactory doesn't exist
[C:\Users\developer-1\Downloads\app-sa (2)\src\app\app.module.ngfactory]
[C:\Users\developer-1\Downloads\app-sa (2)\src\app\app.module.ngfactory.ts]
[C:\Users\developer-1\Downloads\app-sa (2)\src\app\app.module.ngfactory.js]
[C:\Users\developer-1\Downloads\app-sa (2)\src\app\app.module.ngfactory.json]
[C:\Users\developer-1\Downloads\app-sa (2)\src\app\app.module.ngfactory]
 @ ./src/app/main.ts 2:0-60
    at BuildError.Error (native)
    at new BuildError (C:\Users\developer-1\Downloads\app-sa (2)\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at callback (C:\Users\developer-1\Downloads\app-sa (2)\node_modules\@ionic\app-scripts\dist\webpack.js:121:28)
    at emitRecords.err (C:\Users\developer-1\Downloads\app-sa (2)\node_modules\webpack\lib\Compiler.js:269:13)
    at Compiler.emitRecords (C:\Users\developer-1\Downloads\app-sa (2)\node_modules\webpack\lib\Compiler.js:375:38)
    at emitAssets.err (C:\Users\developer-1\Downloads\app-sa (2)\node_modules\webpack\lib\Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (C:\Users\developer-1\Downloads\app-sa (2)\node_modules\webpack\lib\Compiler.js:368:12)
    at next (C:\Users\developer-1\Downloads\app-sa (2)\node_modules\tapable\lib\Tapable.js:218:11)
    at Compiler.compiler.plugin (C:\Users\developer-1\Downloads\app-sa (2)\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (C:\Users\developer-1\Downloads\app-sa (2)\node_modules\tapable\lib\Tapable.js:222:13)

ionic info


cli packages: (C:\Users\developer-1\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v6.9.1
    npm  : 5.0.3
    OS   : Windows 7

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy

Posts: 1

Participants: 1

Read full topic

Help me with modal

Global variables typescript not defined

$
0
0

@Antonini wrote:

Hi all,

I have a problem with typescript global variable.

I’m writing a piece of code to login with facebook in my ionic 3 app.

I have a global variable declared, but when the app runs, got me the error FB is not defined at the function FB.init({})

The code:

//all needed imports

declare const FB;

@Injectable()
export class AuthenticationProvider implements OnInit{

  //properties

  //constructor

   ngOnInit() {
     debugger
     if( FB != null && FB != 'undefined')
     {
       FB.init({
         appId: '***',
         cookie: false,access
         status: true,
         xfbml: true,
         version: 'v2.11'
       });
     }
   }

   //FB.login(){} inside an observable function
   //FB.getLoginStatus(){} inside an observable function
   //FB.api(){} inside an observable function

 }

Can someone help me?

Posts: 1

Participants: 1

Read full topic

Whatsup href ionic?

$
0
0

@ahmadklsany wrote:

Hello
I need some thing like this to open whatsup App by whats up number
i have searched, I find this code but it is not work .
<button ion-button color="light" *ngIf="ProfileInfo.whats_up_number"><a href="whatsapp:{{ProfileInfo.whats_up_number}}"><ion-icon name="logo-whatsapp"></ion-icon></a></button>
thanks.

Posts: 1

Participants: 1

Read full topic

App block in splashScreen on some android device

Hidden content on button click not responding ion tab

$
0
0

@bsakweson wrote:

I ran into this interesting issue today. I have a view combination of ion-tab and sidemenu for the same content pages. In one of them I am using hidden attribute to display a form view when a button is clicked. I noticed that when I navigate to that view from the ion-tab the view does not respond to button clicks. On the other hand when I navigate to that page from the sidemenu everything works as expected.

I read something pertaining to zone issues that may occur if one tries to navigate or push to a new page in the ionViewWillLoad page event but this does not seem to be related because tabs just display pages based on zero-based indices.

Has anyone seen this before?

Posts: 1

Participants: 1

Read full topic

.map is not returning json object to console

$
0
0

@adityapandit17 wrote:

i am new to ionic 3 and i am working on fetching data from my own rails api.
i am getting response on the console but not getting [object] in console.
this is my return code

return this.http.get(this.url)
.do((res: Response) => console.log(res))
.map((res: Response) => res.json())

my json file look like this
[
{
“id”: 1,
“firstname”: “aditya”,
“lastname”: null,
“shirtSize”: null,
“vegetarian”: null,
“created_at”: “2017-10-24T15:13:54.807Z”,
“updated_at”: “2017-10-24T15:13:54.807Z”
},
{
“id”: 2,
“firstname”: “aditya”,
“lastname”: “pandit”,
“shirtSize”: “M”,
“vegetarian”: true,
“created_at”: “2017-10-24T15:14:28.080Z”,
“updated_at”: “2017-10-24T15:14:28.080Z”
},
{
“id”: 3,
“firstname”: “ravi”,
“lastname”: “singh”,
“shirtSize”: “M”,
“vegetarian”: null,
“created_at”: “2017-10-24T15:15:48.386Z”,
“updated_at”: “2017-10-24T15:15:48.386Z”
},
{
“id”: 5,
“firstname”: “jai”,
“lastname”: “sharma”,
“shirtSize”: “M”,
“vegetarian”: true,
“created_at”: “2017-10-26T11:12:01.449Z”,
“updated_at”: “2017-10-26T11:12:01.449Z”
},
{
“id”: 6,
“firstname”: “nikita”,
“lastname”: “pandey”,
“shirtSize”: “M”,
“vegetarian”: true,
“created_at”: “2017-10-26T13:14:37.462Z”,
“updated_at”: “2017-10-26T13:14:37.462Z”
},
{
“id”: 7,
“firstname”: “anand”,
“lastname”: “kumar”,
“shirtSize”: “L”,
“vegetarian”: true,
“created_at”: “2017-11-13T12:53:37.544Z”,
“updated_at”: “2017-11-13T12:53:37.544Z”
}
]

Posts: 1

Participants: 1

Read full topic


How to call the data in page.html

$
0
0

@zuekegreen wrote:

Hi guys can you help me on how to call this type of JSON data in HTML ?

here’s my JSON data in my read.php

[{"id":"17","files":"11.17.17.xls","title":"awdawd","description":"wdwad"},
{"id":"18","files":"OJT-form-BSIT-3-2.doc","title":"wew","description":"awa"},
{"id":"19","files":"11.2.17.xlsx","title":"21515","description":"525465"}]

and this is my main.html ,

    provider.loadData()
    .then(data => {
     console.log(data);
     this.fileData = data;
    })
  }

How can i call it in my main.html ?

i use this code ,

<ion-content padding>
    <ion-list>
     <a *ngFor="let file of fileData">
       <h1>{{files}}</h1>
       <h2>{{title}}</h2>
       <p>{{description}}</p>
     </a>
    </ion-list>

  </ion-content>

and im getting error…
please help me

Posts: 3

Participants: 2

Read full topic

Query for an established user's username

$
0
0

@lhimelman wrote:

I am trying to get the username of a user based on their uid in the following firebase structure:

I think I am able to get the user document but not the specific username value with the following line:

var username = this.afs.collection('users', ref => ref.where('uid', '==', uid)).valueChanges()

I am using the query documentation from AngularFire2:

Posts: 1

Participants: 1

Read full topic

Ionic Battery Optimization

$
0
0

@texasman03 wrote:

My ionic app has a background activity of about 19 - 20%, and sucks a lot of battery. Is there any way to optimize it? I don’t have any intervals running or anything, so I’m not sure what’s going on. Here’s my plugin list:

      "ionic-plugin-keyboard": {},
      "cordova-plugin-app-version": {},
      "cordova-plugin-x-socialsharing": {},
      "cordova-plugin-google-analytics": {},
      "cordova-plugin-add-swift-support": {},
      "cordova-plugin-screen-orientation": {},
      "cordova-plugin-apprate": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-splashscreen": {},
      "cordova-clipboard": {},
      "cordova-plugin-network-information": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-inappbrowser": {}

Posts: 1

Participants: 1

Read full topic

Android build failed after updating cordova@6.4

$
0
0

@pe1 wrote:

Hi, after updating cordova@6.4 i got build error:

BUILD FAILED in 1m 25s
39 actionable tasks: 39 executed
Error: cmd: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/cordova/BuildHelper.class

Any advice appreciated

 @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 3.1.5
    Cordova Platforms  : android 6.4.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 25.2.5
    Node              : v6.9.2
    npm               : 5.3.0
    OS                : Windows 7

Posts: 1

Participants: 1

Read full topic

Http post not works with new version

$
0
0

@mdline wrote:

Hello,

I am pretty desperate, I don’t understand why the http post does not work after updated to newer version.
I test both on IOS device.

Works: The code below is with version @angular/http 4.4.3

  public login(username: string, passwd: string): Observable<string> {
    let headers = new Headers({'Content-Type': 'application/x-www-form-urlencoded'});
    let options = new RequestOptions({headers: headers, withCredentials: true });
    let params: URLSearchParams = new URLSearchParams();
    params.set('target', 'https://xxx');
    params.set('username', username);
    params.set('password', passwd);
    return this.http.post('https://xxx', params, options)
      .map(this.returnData)
      .catch(this.handleError);
  }

  private returnData(res: Response) {
    if (JSON.stringify(res.text()).indexOf('error') === -1) {
      return res || {};
    } else {
      throw {message: 'Error occured'};
    }
  }

  private handleError (error: any) {
    return Observable.throw(error.message);
  }

Not works: The code below is with newer version @angular/http 5.1.0

  public login(username: string, passwd: string): Observable<string> {
    const headers = new HttpHeaders();
    headers.append('Content-Type,', 'application/x-www-form-urlencoded');
    const options = {headers: headers, withCredentials: true};
    const body = {
      target: 'https://xxx',
      username: username,
      password: passwd
    };
    return this.http.post('https://xxx', body, options)
      .map(this.returnData)
      .catch(this.handleError);
  }

  private returnData(res: HttpResponse<Response>) {
    if (res.ok) {
      return res || {};
    } else {
      throw {message: 'Error occured'};
    }
  }

  private handleError(error: HttpErrorResponse) {
    return Observable.throw(error.message);
  }

Posts: 2

Participants: 2

Read full topic

Tabs not on RootPage

Node-Sass binding environment - Ionic Pro Building Error

$
0
0

@nolanmclark wrote:

Boy this is a messy one. I’ve tried removing node modules and reinstalling, rebuilding node-sass, downgrading node-sass, so I can’t help but think this is on the Ionic Pro side. Here’s my stack trace from the Ionic Pro failed build.

Running with gitlab-ci-multi-runner 9.1.0 (0118d89)
  on Snapshot Builds (c9648220)
Using Shell executor...
Running on ip-10-2-1-50...
Cloning repository...
Cloning into '/home/gitlab-runner/builds/c9648220/0/project-1'...
Checking out 2599d64b as master...
Skipping Git submodules setup
$ run "fetch-updates"
Running Job: 5155960
Checking for build process updates...
$ run "build-app"
Running Job: 5155960
Attempting to restore cached packages...
Package cache restored!
$ npm run build
npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.2.1
npm info lifecycle paths@0.0.1~prebuild: paths@0.0.1
npm info lifecycle paths@0.0.1~build: paths@0.0.1

> paths@0.0.1 build /usr/src/app
> ionic-app-scripts build

/usr/src/app/node_modules/@ionic/app-scripts/node_modules/node-sass/lib/binding.js:15
      throw new Error(errors.missingBinary());
      ^

Error: Missing binding /usr/src/app/node_modules/@ionic/app-scripts/node_modules/node-sass/vendor/linux-x64-57/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x

Found bindings for the following environments:
  - OS X 64-bit with Node.js 8.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
    at module.exports (/usr/src/app/node_modules/@ionic/app-scripts/node_modules/node-sass/lib/binding.js:15:13)
    at Object. (/usr/src/app/node_modules/@ionic/app-scripts/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object. (/usr/src/app/node_modules/@ionic/app-scripts/dist/core/bundle-components.js:6:16)
npm info lifecycle paths@0.0.1~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! paths@0.0.1 build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!

Build works totally fine on my Mac. I think it’s trying to build with Linux on the server side and running into issues.

ionic-info:

cli packages: (/Users/user/Desktop/Development/Paths/node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.5
    Cordova Platforms  : android 6.2.3 browser ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.1
    ios-sim    : 6.1.2
    Node       : v8.2.1
    npm        : 5.3.0
    OS         : macOS High Sierra
    Xcode      : Xcode 9.2 Build version 9C40b

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

Any help?

Posts: 1

Participants: 1

Read full topic


Ionic 3 + Crosswalk: support cookies

$
0
0

@manuarguedev wrote:

Hi! My app does login against a server who returns a response with the Cookie-Set header. For any further request the app makes to the server, need to put the same cookie on the request.

I’ve tried doing this creating an HTTP interceptor but the app is not sending the cookie in the request.

Is there a way to automatic support the use of cookies?

Thanks!

Posts: 1

Participants: 1

Read full topic

Can I subscribe Observable from service provider?

$
0
0

@JeffMinsungKim wrote:

Hello guys. I have one question to ask. I’m kinda new to Ionic so I wonder whether I could subscribe observable from service or not. If so, how can I unsubscribe it when the user signs out from my application?

This is my user service provider.

user-service.ts

 getCurrentUsername() {
    return this.afDB.object(`users/${this.currentUserId}/username`).valueChanges();
  }

sendFriendRequest(recipient: string) {
    let senderInfo = {
      sender: this.currentUserId,
      username: // I would like to include username as an object.
      timestamp: Date.now(),
      message: 'wants to be friend with you.'
    }
    return new Promise((resolve, reject) => {
      this.afDB.list(`friend-requests/${recipient}`).push(senderInfo).then(() => {
        resolve({'status': true, 'message': 'Friend request has sent.'});
      }, error => reject({'status': false, 'message': error}));
    });
  }

Posts: 3

Participants: 3

Read full topic

Ionic suitability for a large scale app?

$
0
0

@Jamie88 wrote:

Hi all.

My sincerest apologies if this isn’t the correct place to post this.

I was wondering how suitable Ionic is for a large scale app?

I haven’t delved into Ionic much yet and my experience of a HTML5 app was using Sencha Touch to build an app for a client (there wasn’t ever a large amount of users using it at any one time) and wrapped into Android and iOS apps using Cordova. It worked really well (CORS issues aside) but because it wasn’t native it felt rather clunky and “forced” and not to mention “hacky” because of CSS overrides, positions etc and this is what I’m concerned about with Ionic.

My company is creating a platform for trading goods and a typical scenario might be that a particular item has tens of thousands (maybe more) of different variations, and each with different variations again etc and this must be narrowed down using select fields. The user can then find items to trade with. All of this searching and narrowing down would obviously be handled by the server and DBs so all Ionic would need to do is display the data and lazy load the next page etc.

Would Ionic perform? I’m looking at Ionic because of the native UI it provides across the different platforms (and one code stream) and we need it to look identical whether it’s running on iOS or Android. The only sticking point here is I would need to get my head around Angular/Ionic API but that’s fine. I’m also concerned about the hacky nature of manually styling components, positioning etc which you don’t really get with native development (significantly less so at least).

I’m receiving a bit of resistance from one of my guys with using this over Java/Swift for native apps. An honest assessment would be much appreciated.

I really appreciate your thoughts and advice.

Thanks guys :smile:

Posts: 1

Participants: 1

Read full topic

How can use a custom theme for my application

$
0
0

@umutgur wrote:

Hi there,

I bought an ionic theme, its name is Musicana. But how can use that? I tried copy all files to www directory, but when I start app again src files override my template.

Thanks for your hepls.

Posts: 3

Participants: 2

Read full topic

Alertcontroller

$
0
0

@Arugama wrote:

Someone knows how to restart a form and return to the home page through the handler button in this method (AlertController)

ex:

this.alertCtrl.create({
title:'Example',
subTitle: 'this is an example',
button:[
  {
 text:'Done! everything look good',
 handler: () => {

  }
}
}

Posts: 2

Participants: 2

Read full topic

Viewing all 49526 articles
Browse latest View live