ionic3

Ionic Cannot find module '../providers/auth-service/auth-service'

混江龙づ霸主 提交于 2019-12-01 19:59:11
I am trying to create Login/SignUp in ionic angular 3.3.0. I get the error Cannot find module '../providers/auth-service/auth-service'. in the login.ts file. Please Help! auth-service.ts import { Injectable } from '@angular/core'; import { Http } from '@angular/http'; import {Observable} from 'rxjs/Observable'; import 'rxjs/add/operator/map'; /* Generated class for the AuthServiceProvider provider. See https://angular.io/docs/ts/latest/guide/dependency-injection.html for more info on providers and Angular 2 DI. */ export class User { name: string; email: string; constructor(name: string, email

Getting error on ionic cordova build android

耗尽温柔 提交于 2019-12-01 19:37:23
问题 Just started to learn ionic 3. Getting below error on ionic cordova build android (node:6364) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): [object Object] (node:6364) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. Below is my ionic info. cli packages: (C:\Users\HIT\AppData\Roaming\npm\node_modules) @ionic/cli-utils

Ionic 3: Build in “prod” mode: Cannot find module “.”

放肆的年华 提交于 2019-12-01 18:13:20
we have a large Ionic app that we’re trying to build in production mode since it’s almost ready. The first issue we found is that we were getting a “ JavaScript heap out of memory” error when compiling, but we fixed it by giving more memory to node: "ionic:build": "node --max-old-space-size=16384 ./node_modules/@ionic/app-scripts/bin/ionic-app-scripts.js build", npm run ionic:build -- --prod With this command the app successfully builds, but if I open it I get the following error: Uncaught Error: Cannot find module “.” at vendor.js:1 at vendor.js:1 at Object. (vendor.js:1) at e (vendor.js:1)

Angular2 EXCEPTION No provider for String

妖精的绣舞 提交于 2019-12-01 16:55:36
I've got a brand new app create with a ng-cli with this very simple code ^^ import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { constructor(private my: string) {} } and I've got in the console EXCEPTION: No provider for String! I don't see any error in the code so what's wrong ! In ng-book I can read export class Article { title: string; link: string; votes: number; constructor(title: string, link: string, votes?: number) { this.title = title; this.link = link; this

Ionic 3: Build in “prod” mode: Cannot find module “.”

淺唱寂寞╮ 提交于 2019-12-01 16:34:27
问题 we have a large Ionic app that we’re trying to build in production mode since it’s almost ready. The first issue we found is that we were getting a “ JavaScript heap out of memory” error when compiling, but we fixed it by giving more memory to node: "ionic:build": "node --max-old-space-size=16384 ./node_modules/@ionic/app-scripts/bin/ionic-app-scripts.js build", npm run ionic:build -- --prod With this command the app successfully builds, but if I open it I get the following error: Uncaught

ionic 3 image slider stops autoplay after manual sliding

亡梦爱人 提交于 2019-12-01 16:14:30
Ionic 3 image slider autoplay works well, but when I slide the image manually the autoplay stops working. Below is my ionic 3 code. I am really stuck here.. slideData = [{ image: "../../assets/img1.jpg" },{ image: "../../assets/img2.jpg" },{ image: "../../assets/img3.jpg" }] html code is as below <ion-slides class="slide-css" autoplay="100" loop="true" speed="100" pager="true" autoplayDisableOnInteraction = "false"> <ion-slide *ngFor="let slide of slideData"> <img src="{{slide.image}}" /> </ion-slide> </ion-slides> Update: You need to use it like this: import { Component, ViewChild } from '

Ionic 3 Login Authentication Using API - Cannot read property 'json' of null

两盒软妹~` 提交于 2019-12-01 15:42:58
I am doing authentication in Ionic 3 using API but In the login process, it is showing error: Cannot read property 'json' of null This is my providers>restapi>restapi.ts import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import {Http, Headers} from '@angular/http'; let apiUrl = 'http://192.168.1.10/honeybee/HoneyApi/'; @Injectable() export class RestapiProvider { constructor(public http: HttpClient) { console.log('Hello RestapiProvider Provider'); } getUsers(credentials, type) { return new Promise((resolve, reject) => { var headers = new Headers();

ionic 3 image slider stops autoplay after manual sliding

我的未来我决定 提交于 2019-12-01 15:23:50
问题 Ionic 3 image slider autoplay works well, but when I slide the image manually the autoplay stops working. Below is my ionic 3 code. I am really stuck here.. slideData = [{ image: "../../assets/img1.jpg" },{ image: "../../assets/img2.jpg" },{ image: "../../assets/img3.jpg" }] html code is as below <ion-slides class="slide-css" autoplay="100" loop="true" speed="100" pager="true" autoplayDisableOnInteraction = "false"> <ion-slide *ngFor="let slide of slideData"> <img src="{{slide.image}}" /> <

Ionic - How can I programmatically set the text color of an item?

可紊 提交于 2019-12-01 12:16:01
In Ionic (3), how can I programmatically set the text color of an item? For example, clicking on a list item will change (toggle) the color of the list item. <ion-content> <ion-content padding> <ion-list> <ion-item *ngFor="let element of elements" #listitem (click)="changeTextColor(listitem)"> Click to change text color of {{element}} </ion-item> </ion-list> </ion-content> With the code of the changeTextColor: changeTextColor( listitem) { console.log( 'changing text color'); listitem._color="danger"; } So this seems to be a "Restyle X when Y happens"-question, I'll try to explain the steps to

Ionic serve not working in Ionic 3

无人久伴 提交于 2019-12-01 12:10:36
问题 My Ionic info: cli packages: (/usr/lib/node_modules) @ionic/cli-utils : 1.9.2 ionic (Ionic CLI) : 3.9.2 global packages: Cordova CLI : 7.0.1 local packages: @ionic/app-scripts : 3.1.0 Cordova Platforms : browser 4.1.0 Ionic Framework : ionic-angular 3.9.2 System: Node : v6.9.0 npm : 3.10.8 OS : Linux 4.4 Ionic serve is working fine, but does not detect any file changes! The problem appears only for Ionic v3 and v2 projects. My Ionic v1 projects are working fine. 回答1: For update changes in