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

Command to generate page and inject it app.module.ts

$
0
0

@Santosh_Hegde wrote:

ionic generate [] [] will generate the page. But there is flag which will include this page in app.module.ts as well.

How can I generate and inject it into other modules?

Posts: 1

Participants: 1

Read full topic


Not abel to access value in angular 2 or ionic 2

$
0
0

@chandelkushal wrote:

HI Team

I Have a json and i want to access a value with colon string and i am not abel to access that value please find the screenshot for reference.
eg: i want to access wp:featuredmedia but i am not abel to do soo.51 PM

Please help me in this.

Posts: 1

Participants: 1

Read full topic

Ionic cordova build android --prod --release fails

$
0
0

@akr_rajkumar wrote:

Hi,
I’m working with Ionic 3. When I try cordova build android --prod --release, build comes. but the signed APK is showing white screen after splash. When I try ionic cordova build android --prod --release, it is showing the following error. Please help me out on this. Very urgent. Thanks in advance

Posts: 1

Participants: 1

Read full topic

Service Calling problem Ionic

$
0
0

@pendora7 wrote:

Hey, I am using a service to get last ID and Username from a JSON URL.
It was working great, but suddenly it stopped working. When i install the application on a device, first time it displays result correctly but doesn’t show next entry instead it shows that 1st entry again and again.

My service is: http://server2.a2zcreatorz.com/staging/projects/bayer-survey/bayer/fetchsurveyeeid.php
My calling method:

Thank You

Posts: 1

Participants: 1

Read full topic

The best way to serve different pages for each platform?

$
0
0

@JeffMinsungKim wrote:

Objective

What I want to accomplish here is to find out the cleanest way to write some service code to check the current user’s device or platform and to serve a different view by following the condition. For example, in a mobile device, tabs in the bottom, on the other hand in a desktop browser should hide tabs and show split pane on the left side ONLY.

I’ve already read several threads related to this topic including the documentation about the platform, but still, I get stuck in the middle of the problem. :frowning:

Project structure

app.component.ts

export class MyApp {
  rootPage:string;

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
    firebase.initializeApp(environment.firebase);

    const unsubscribe = firebase.auth().onAuthStateChanged(user => {
      if (user) {
        this.rootPage = 'HomePage'; // Tabs reside in this page
        unsubscribe();
      } else {
        this.rootPage = 'LoginPage'; // When user is not authenticated
        unsubscribe();
      }
    });

    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      statusBar.styleDefault();
      splashScreen.hide();
    });
  }
}

home.ts

export class HomePage {
  firstTab: string = 'UserPage';
  secondTab: string = 'ChatPage';
  lastTab: string = 'SettingPage';

  constructor() { }

}

home.html

<ion-tabs>
    <ion-tab [root]="firstTab" tabTitle="Users" tabIcon="ios-people"></ion-tab>
    <ion-tab [root]="secondTab" tabTitle="Chats" tabIcon="ios-chatbubbles"></ion-tab>
    <ion-tab [root]="lastTab" tabTitle="Settings" tabIcon="ios-settings"></ion-tab>
</ion-tabs>

login.ts

export class LoginPage {
  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    private platform: Platform,
    private authService: AuthServiceProvider,
    private userService: UserServiceProvider) {

    // I don't think it's a good idea to place device validation here
    if (this.platform.is('core'))
      console.log('Web');
    else
      console.log('Mobile');
  }

  async login() { ... }
}

user.ts

export class UserPage {
  private subscription: Subscription;
  private loggedInUser: any[];
  private users: any[];

  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    private userService: UserServiceProvider,
    private authService: AuthServiceProvider) { }

  getVerifiedUsers() { ... }

  getLoggedInUser() { ... }
}

cli packages: (/usr/local/lib/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.4
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2

System:

Node  : v8.9.0
npm   : 5.5.1
OS    : OS X El Capitan
Xcode : Xcode 8.0 Build version 8A218a

Posts: 1

Participants: 1

Read full topic

Post method in ionic 3 with Lumen

$
0
0

@ElHombreSinNombre wrote:

Nowadays I working on sample project in Ionic 3, this project is a CRUD (Create, Read, Update, Delete).

I have a API with Lumen, and all endpoints works perfectly, I tested with Postman. This is route and controller code.

Route

$router->group(['prefix' => 'visitas'], function () use ($router) {
$router->get('/', [
    'as' => 'visitas.read', 'uses' => 'VisitaController@read'
]);

$router->get('/{id}/edit', [
    'as' => 'visita.edit', 'uses' => 'VisitaController@edit'
]);

$router->delete('/{id}', [
    'as' => 'visita.destroy', 'uses' => 'VisitaController@destroy'
]);

$router->put('/{id}', [
    'as' => 'visita.update', 'uses' => 'VisitaController@update'
]);

$router->post('/create', [
    'as' => 'visita.create', 'uses' => 'VisitaController@create'
]);
});

Controller


public function create(Request $request)
    {

        $this->validate($request, [
            'nombre' => 'required',
            'dni' => 'required',
            'visitado_id' => 'required'
        ]);

        Visitas::create($request->all());
    }

In Ionic I have a provider with this

createVisita(data) {
    console.log(data);
    return this.http.post('http://visitas.api.app:8000/visitas/create/',data)
      .map(res => res.json())
      .toPromise();
  }

And controller look like this

newVisita() {
    this.visitasCtrl.createVisita(this.create)
    .then(createData => {
      this.createData = createData;
    })
    this.navCtrl.pop();
  }

This.create retrieve all form data but don’t save and return a url error. I think this is a promise (or something like that) error but not sure. I need to do this insert in database and then go to back view with pop().

¿Any idea what’s wrong?

Posts: 1

Participants: 1

Read full topic

Import external javascript to Ionic

$
0
0

@zymethyang wrote:

I am facing some problem when try to import javascript library to my Ionic app, specifically import this chart into my ionic project

https://github.com/rendro/easy-pie-chart.

Firstly I install the latest ionic, after that go to

/src/

open the assets folder, create a

/js/

folder inside assets copy .js inside this js folder goto

/src/index.html

Add path <script src="assets/js/N.js">
Go to typescript file and declare var N;

And another way like this video: https://www.youtube.com/watch?v=xWIzZ8wBqk0

But both of them didn’t worked. Do you have any else idea ? Thank you.

Posts: 1

Participants: 1

Read full topic

Speedometer or strength meter shown as round dial form

$
0
0

@muralijai wrote:

Can any one in ionic team tell me if there is a speedometer or strength meter shown as round dial form available in ionic? Do I have to buy the app with code if available etc

Thanks in advance.

Posts: 2

Participants: 1

Read full topic


Cannot read property 'nh' of undefined?

Ionic3 - App Navigation handled by the authentication

$
0
0

@orlstefano wrote:

I’ve try to handle the navigation by the check of current authentication of user. I’ve use a Observable in my AuthProvider to check user authentication status and

I’ve use this to set the root page in my app.component.ts.

export class MyApp {
rootPage: any = LoginPage;
  isLoggedIn$: Observable<boolean>;
enter code here
constructor(platform: Platform,
statusBar: StatusBar,
splashScreen: SplashScreen,
private authService: AuthServiceProvider) {

this.isLoggedIn$ = authService.isLoggedIn();
platform.ready().then(() => {
  //check user logged
  this.isLoggedIn$.subscribe(res => {
    if (res) {
      this.rootPage = TabsPage; //Home page if user is logged in
    } else {
      this.rootPage = LoginPage; //Login page if user isn't logged id
    }
  });

  statusBar.styleDefault();
  splashScreen.hide();
});
}

The check function isLoggedIn() in my authProvider is

  isLoggedIn(): Observable<boolean> {
return this.user.map((auth) => {
  if (auth == null) {
    return false;
  } else {
    return true;
  }
});
}

I’ve use Firebase and AngularFireAuth to handle the login and logout process. The logout function in my AuthProvider is…

logout() {

this.afAuth
  .auth
  .signOut();
}

This code work very fine if I access in my app and I never use…

this.navController.push(ChildPage) //it work fine but cause error in next logout-login fase

or

this.navController.push('ChildPage') //it work fine but cause error in next logout-login fase

Ex. I haven’t problems if I use TabController for navigation.

Steps to get Error:

User is unauthenticated and open the app

  1. LoginPage -> login(credential) -> HomePage
  2. HomePage -> goToChildPage(page){this.navController.push(ChildPage);} -> ChildPage
  3. ChildPage -> authProvider.logOut() -> LoginPage
  4. LoginPage -> login(credential) -> DESPERATION :frowning:
  5. In the fifth step I recive this error:
ERROR TypeError: Cannot read property 'push' of null
at Tab.NavControllerBase._queueTrns (VM5768 vendor.js:51240)
at Tab.NavControllerBase.push (VM5768 vendor.js:51128)
at SafeSubscriber._next (VM5769 main.js:214)
at SafeSubscriber.__tryOrUnsub (VM5768 vendor.js:22842)
at SafeSubscriber.next (VM5768 vendor.js:22789)
at Subscriber._next (VM5768 vendor.js:22729)
at Subscriber.next (VM5768 vendor.js:22693)
at MapSubscriber._next (VM5768 vendor.js:124303)
at MapSubscriber.Subscriber.next (VM5768 vendor.js:22693)
at SwitchMapSubscriber.notifyNext (VM5768 vendor.js:135509)

Can someone help me please?

Thank you :slight_smile:

Posts: 1

Participants: 1

Read full topic

Problem release installation Ionic 2 Invalidate Certificate

$
0
0

@remiprivet wrote:

Hey all,

I have a problem trying to run the following command :
ionic cordova run android --release --prod

The Apk is generated, but during the installation to my device, it fails with this Error :

Failed to install platforms/android/build/outputs/apk/android-release-unsigned.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Package /data/app/vmdl387174112.tmp/base.apk has no certificates at entry AndroidManifest.xml]

Does anyone already encountered this problem ?

Thank you by advance !
Rémi

Posts: 1

Participants: 1

Read full topic

App not serving

Implementing VideoGular 2 in an ionic 3 project

$
0
0

@Xdabier wrote:

Hey everyone,
I was trying to implement videogular 2 in my project,
but in the videogular 2 website get started section they said I should
add this code to the .angular-cli.json, but I can’t seem to find it’s equivalent in ionic,

{
   ...
   "apps": [
       {
           ...
           "styles": [
               "../node_modules/videogular2/fonts/videogular.css",
               "styles.scss"
           ],
           ...
       }
   ],
   ...
}

does anyone know the best way to implement this component ?

Posts: 1

Participants: 1

Read full topic

Getting ionic to run on phone - stuck on xcode settings

$
0
0

@JAR19 wrote:

I am finally at the stage where I am attempting to get my app running on iOS.

The main problem is that xcode is totally new to me - so I am finding it difficult to configure it correctly.

I have signed up to the Apple developers program and downloaded the certificates and built the Ionic app successfully on a mac.

This is where the confusion beings - xcode says it needs a development team:

but if I go into xcode perefences - account I have them setup.

From this page I cannot see the option to enable signing.

I have followed the ionic guide but the screen images are no longer the same.

Any pointers would be welcome!

Posts: 1

Participants: 1

Read full topic

Paypal checkout express button not showing on iOS Simulator

$
0
0

@thruthesky wrote:

Good morning.

I am trying to put a paypal express checkout button.

It works fine with chrome, safari, Android AVD.

But When I run it on iOS Simulator the button is not rendered properly.

Does anyone know why?

Button to be expected:
image

Button in iOS Simulator that is not rendered:
image

Posts: 1

Participants: 1

Read full topic


List in tabs are not being loaded

$
0
0

@hfaouaz wrote:

Hello,
Each tab page I have has a list item to show. Initially the list is empty, and I need to move away from the tab and come back to it so the list gets rendered. I’ve tried to use ionViewDidLoad, ionViewDidEnter, ionViewWilEnter to initialize the list, but no luck. Is there a way to force the list to be populated before the tab show the page?

thanks in advance for your time.

Posts: 1

Participants: 1

Read full topic

How to display the file from mysql database into Ionic App

$
0
0

@zuekegreen wrote:

Hi , im new to Ionic , i creating a project which will display a file like docx, ppt. jpg. or txt. file , my server is php .
1st ive created File upload in php and it will save it in my database , the problem is , i dont know how to display the file that i uploaded from php server into my Ionic app , i search a lot of things on online but i can get any tutorial about this. can somebody help me about my problem ? I am doing this for a months .

Posts: 1

Participants: 1

Read full topic

Ionic search issue

$
0
0

@jamesharvey wrote:

Hello guys,

I’m making a search bar on my Ionic app.

Here’s an example data list:

homes = [
{
"h_id": "3",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"price": "162500"
}, {
"h_id": "4",
"city": "Bevery Hills",
"state": "CA",
"zip": "90210",
"price": "319250"
}, {
"h_id": "5",
"city": "New York",
"state": "NY",
"zip": "00010",
"price": "962500"
}
];

Here’s my Typescript:

filterItems(searchTerm){

    return this.items.filter((item) => {
        return item.title.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1;
    });

}

I want to be able to search not just titles but also price, zip, city and state. and this search bar should not be case sensitive. It appears to be case sensitive… but I want it to search regardless of capital letters, lowercase letters, numbers.
How should I edit this typescript?

Please help!

Thanks,

Posts: 1

Participants: 1

Read full topic

(primary: (base: #488aff, contrast: #000)) isn't a valid CSS value

$
0
0

@zanzofily wrote:

My code:

$colors: (
  primary:    (base: #488aff, contrast:#000),
  secondary:  (base: #32db64, contrast:#000),
  danger:     (base: #f53d3d, contrast:#000),
  light:      (base: #f4f4f4, contrast:#000),
  dark:       (base: #222, contrast:#000),
  font:        (base: #fe5295, contrast:#000)
);

Error:

(primary: (base: #488aff, contrast: #000), secondary: (base: #32db64, contrast: #000), danger: (base: #f53d3d, contrast: #000), light: (base: #f4f4f4, contrast: #000), dark: (base: #222, contrast: #000), font: (base: #fe5295, contrast: #000)) isn't a valid CSS value.

Versions:


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

global packages:

    cordova (Cordova CLI) : 6.4.0

local packages:

    @ionic/app-scripts : 3.1.4
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v6.9.2
    npm  : 5.5.1
    OS   : Windows 10

Any ideas?

Posts: 1

Participants: 1

Read full topic

How to read ID3 tags from files on SD card

$
0
0

@sebastienguillon1 wrote:

In an Ionic 3 app, I am trying to read ID3 tags from files stored on the SD card. I tried to use jsmediatags but only get various errors, including crashes.

I am able to import jsmediatags properly with:

import * as jsmediatags from 'jsmediatags';

The typical call to read a file’s tags would be similar to this:

const localFile: string = 'file:///storage/emulated/0/song.mp3';
jsmediatags.read(localFile, {
  onSuccess: function(tags) {
    console.log('RESOLVED - jsmediatags.read');
    console.log(tags);
  },
  onError: function(error) {
    console.log('REJECTED - jsmediatags.read');
    console.log(error);
  }
});

This always fails (I get ‘REJECTED - jsmediatags.read’ in the console).

I must say that I am perfectly able to play this same file with the Ionic native Media plugin. The path is correct, the file is playable and contains ID3 tags.

Note: I am only after Android compatibility (for the moment).

Posts: 1

Participants: 1

Read full topic

Viewing all 49526 articles
Browse latest View live


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