mhartington / ama Goto Github PK
View Code? Open in Web Editor NEWThis project forked from aviflombaum/ama
Ask me anything!
This project forked from aviflombaum/ama
Ask me anything!
I am using angular-ui/bootstrap the component Rating (ui.bootstrap.rating). my issue that max proporty isnt working correctly when I am using collection-repeat, its shows me always only one icon max, Also when I trying to play with pro of collection-repeat then search some time showing less icons.but If I an using ng-repat all works great. this my code:
<li class="item" collection-repeat=" contact in contacts |filter: data.searchText">
<!--<li class="item" ng-repeat=" contact in contacts |filter: data.searchText">-->
<div class="row larger font">
<div class ="col" ng-init="contact.active"><uib-rating ng-model="contact.active" max={{contact.total}} state-on="'ion-person-stalker positive '" state-off="'ion-person-stalker'" ng-click="changeActive(contact);data.searchText =''"></uib-rating> </div>
the basic link for code of it plnkr this is without collection repeat
http://codepen.io/vitaly87/pen/MeweJB?editors=0001
UPDATE: link with example updated.
link to q:
Failing test log
ClientsPage should create FAILED
Error: StaticInjectorError(DynamicTestModule)[IonRouterOutlet -> ChildrenOutletContexts]:
StaticInjectorError(Platform: core)[IonRouterOutlet -> ChildrenOutletContexts]:
NullInjectorError: No provider for ChildrenOutletContexts!
at NullInjector.get (webpack:///./node_modules/@angular/core/fesm5/core.js?:1360:19)
at resolveToken (webpack:///./node_modules/@angular/core/fesm5/core.js?:1598:24)
at tryResolveToken (webpack:///./node_modules/@angular/core/fesm5/core.js?:1542:16)
at StaticInjector.get (webpack:///./node_modules/@angular/core/fesm5/core.js?:1439:20)
at resolveToken (webpack:///./node_modules/@angular/core/fesm5/core.js?:1598:24)
at tryResolveToken (webpack:///./node_modules/@angular/core/fesm5/core.js?:1542:16)
at StaticInjector.get (webpack:///./node_modules/@angular/core/fesm5/core.js?:1439:20)
at resolveNgModuleDep (webpack:///./node_modules/@angular/core/fesm5/core.js?:8667:29)
at NgModuleRef_.get (webpack:///./node_modules/@angular/core/fesm5/core.js?:9355:16)
at resolveDep (webpack:///./node_modules/@angular/core/fesm5/core.js?:9720:45)
Spec file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ClientsPage } from './clients.page';
import { MenuController, IonicModule } from '@ionic/angular';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
describe('ClientsPage', () => {
let component: ClientsPage;
let fixture: ComponentFixture<ClientsPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ClientsPage],
providers: [{ provide: MenuController, useValue: {} }],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [IonicModule]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ClientsPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
Component
import { Component, OnInit } from '@angular/core';
import { MenuController } from '@ionic/angular';
@Component({
selector: 'app-clients',
templateUrl: './clients.page.html',
styleUrls: ['./clients.page.scss']
})
export class ClientsPage implements OnInit {
constructor(public menuController: MenuController) {}
ngOnInit() {}
}
Component Template
<ion-header>
<ion-toolbar color="dark">
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title> Clients </ion-title>
</ion-toolbar>
</ion-header>
<ion-content margin-top>
<ion-router-outlet></ion-router-outlet>
</ion-content>
Module
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ClientListComponent } from './client-list/client-list.component';
import { ClientDetailComponent } from './client-detail/client-detail.component';
import { ClientsPage } from './clients.page';
import { RouterModule, Route } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { AdminClientService } from './admin-client.service';
@NgModule({
imports: [
IonicModule,
CommonModule,
FormsModule,
RouterModule.forChild([
{
path: '',
component: ClientsPage,
children: [
{
path: '',
component: ClientListComponent
},
{
path: ':id',
component: ClientDetailComponent
}
]
}
])
],
declarations: [ClientsPage, ClientListComponent, ClientDetailComponent],
providers: [AdminClientService]
})
export class ClientsModule {}
Hi Mike,
I have a question about Ionic 2 in combination with Angular 2 modules. Now, when Ionic 2 uses Angular 2 final, it's theoretically possible to build modular application architecture.
My question is, will modular application architecture work in Ionic 2 in the same way it works in Angular 2 and is there something else in addition to keep in mind? Some Ionic specific issues, limitations, etc.?
Angular has updated style guide which includes modules and recommendations how to use them (app root module, core module, shared module, feature modules etc.). There are also some considerations to keep in mind, like where to put shared services between modules and where to put shared components/directives/pipes, so they work properly with lazy loaded modules and dependency injection.
Is this all the same for Ionic 2 project, with the same things to keep in mind?
Thanks in advance for your time!
Hello man,
I have been trying for days to reach you. I have some few customization questions regarding an Magento-Ionic App I have. Please refer to this link.
http://stackoverflow.com/questions/35918923/magento-ionic-app-filtering-categories-and-pages
Please if you can assist me, I will be eternally grateful. We could skype if you are online.
Thanks
Peter
hi mike:
i am a mobile app developer from china,i am using ionic framework to develope,i also read your book learing ionic ,but i had not find the book in chinese,so this morning ,l chated with my colleagues and recommend this book to them,i also propose an idea that we can translate this book into chinese. during this working,we can improve our skills and we can also let more and more developer who come from china know ionic and use it.
there are some questions ,1.had any else translate your book into chinese?2. this is my first time want to translate an english book into chinese, what else should we do ?
No I would like to know a lot more =) Not sure if I had to open plenty of issues or this is gonna work too?
Example of things I'm looking for:
For lists, use VirtualScroll to create "infinite" lists
Thanks!
/Anton
Hey Mike,
I'm working on a social network app for a client using Ionic for front end, and Node.JS / Express.JS for back end.
I was wondering what is the ideal way to implement real time messaging in the app. I understand Socket.io is good for having a chat room with a lot of people in it. But what I'm trying to do is have 1-on-1 messaging like Facebook Messaging or Google Hangouts.
Do you have any suggestions in mind?
Thanks in advance!
Hello,
I'm trying to upload a video capture to my S3 Bucket, but I can't do it.
Maybe I need to configure my bucket, I already allowed POST / PUT / GET in my CORS configuration. I don't know if my policy need to be the same as the policy of my bucket.
Here my code:
'use strict';
app.controller('VideoCtrl', function($scope, $cordovaCapture, $state, $cordovaFileTransfer) {
$scope.record = function(){
var options = { limit: 1, duration: 8 };
$cordovaCapture.captureVideo(options).then(
function(videoData) {
var i, path, len;
var pathtogo;
var pathtogostring;
for (i = 0, len = videoData.length; i < len; i += 1) {
path = videoData[i].fullPath;
pathtogo = path.toString();
$scope.videos.$add(pathtogo);
};
},
$state.go('tab.photo-detail'),
function(err) {
}
);
var options = new FileUploadOptions();
options.fileKey="file";
var fileName = "capturedvideo.MOV";
options.fileName = fileName;
options.mimeType ="video/mov";
options.chunkedMode = false;
var uri = encodeURI("https://<my bucket>.amazonaws.com/");
var policyDoc = "js/signing-util.js";
var signature = "js/signing-util.js";
var params = {
"key": "file",
"AWSAccessKeyId": "<MY AWS Key>",
"acl": "public-read",
"policy": policyDoc,
"signature": signature,
"Content-Type": "video/mov"
};
options.params = params;
$cordovaFileTransfer.upload(videoData[i].fullPath, uri, options)
.then(function(result) {
console.log("SUCCESS: " + JSON.stringify(result.response));
}, function(err) {
console.log("ERROR: " + JSON.stringify(err));
}, function(progress) {
// constant progress updates
});
};
});
My signature / policy doc is this:
var crypto = require('crypto'),
secret = "",
policy,
policyBase64,
signature;
policy = {
"expiration": "2050-12-31T12:00:00.000Z",
"conditions": [
{"bucket": ""},
["starts-with", "$key", ""],
{"acl": 'public-read'},
["starts-with", "$Content-Type", ""],
["content-length-range", 0, 5242880000]
]
};
policyBase64 = new Buffer(JSON.stringify(policy), 'utf8').toString('base64');
console.log("Policy Base64:");
console.log(policyBase64);
signature = crypto.createHmac('sha1', secret).update(policyBase64).digest('base64');
console.log("Signature:");
console.log(signature);
Is something wrong with my code?
PLUS:
I use the default cordova-platform iOS @3.9.2 but every time I got access to my camera on device (iPhone 6 - iOS 9) I receive this error:
Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
Is only a warning issue or is not capturing the video?
Thanks.
I want to disable back button when user goes to particular page (for that page only). For all other page, I want hardware back button to behave normally.
I am facing DEEP link issue in ionic 3 development
Our app pages are build with tabbed interface. So that DEEP link is not working this architecture i.e the main issue is the tabs are not visible in the page when app is opened with deep link. I am using ionic native deep link plugin . I have also tried branch deep link solution but even that is also showing same issue.
In my research, I have identified that the page which we referring to open is getting pushed out of the 'tab view'. See the blue marked ionic page (our pushed page) below, we believe that if we can push the page under ionic tab nodes would resolve the issue.
Have you come across these kind of issue with ionic 3 development ? and any solution to resolve this issue would always be appreciated. Thank You.
Deep Link Implementation Code Snippet
Hi!
First of all, thanks for all the work at Ionic!
What rules are you using for your .gitignore in Ionic? Mine looks like this but not sure if I forgot stuff...
node_modules/
platforms/
plugins/
resources/*/*
Please see the below thread which i have been facing since yesterday while trying to create a new app.
Hi. I recently started working on Ionic project and I really enjoyed your "Ionic and Lazy Loading Pt 1" blog. So, thanks!
Just wanted to see when the part 2 will come! =)
Hi and thanks for making a neovim video and sharing your dotfiles. I'm a newbie in vim/tmux but want to give it a spin to see if it's something that could improve my workflow.
I got two questions about your dotfiles:
<c-p>
, I get this error: Invalid source name "file_rec/neovim2" is detached
. If I change it to file_rec/neovim
in init.vim it works, what do I miss?Thanks again for being open and sharing!
Hey Mike,
I know you probably get this question asked a lot, but I wasn't able to find any answer after Angular 2 beta got released back in December. Would you recommend switching up as soon as ionic 2 beta is released? But until then, is there any particular way ionic 1 apps could be built so they are easier to upgrade if necessary? Lastly, is there any (incredibly) rough date you're planning for the beta release, say, 3 months, 6 months, a year, etc?
Thanks!
Have a nice day.
Did you always have an interest in software, or did you find your skill set led you there?
hi, i see you on many formus and u are so pro... for this reason can u help me how i can build a app with ionic 2 and auth - webservice
Hi Mike
I saw your code pen http://codepen.io/mhartington/pen/CImqy
it is awesome
I am trying to hook callback event
but it is not working
can you do a favour if you can update your pen or guide how to hook callback
It will be really helpfull. I also ping you twitter and it's my first time I am using twitter just for you.
Thank you so much for the efforts.
do you have a demo for ionic that can be put inside the canvas? for example i choose a picture from gallery and the picture will go into that canvas and then i can resize it using the gestures?
thanks a lot!
Hi,
I'm desperately looking for a developer with experience in Ionic and Google Maps. Please help.
Can we have a super-tab native or in a template for ionic 4 like https://github.com/zyra/ionic2-super-tabs
We are developing a mobile app with Ionic 2 and use push notifications, that works fine but icon badge not showing and indicating the count in ANDROID devices.
01. Cloud Setting
const cloudSettings: CloudSettings = {
'core': {
'app_id': 'xxxxxxxx',
},
'push': {
'sender_id': 'xxxxxxxxxx',
'pluginConfig': {
'ios': {
'badge': true,
'sound': true
},
'android': {
'iconColor': '#fff',
}
}
}
};
02. API POST: https://api.ionic.io/push/notifications
{
"tokens": [TOKEN]
"profile": "PROFILETAG",
"notification":
{
"message":"Hi this is a push notification",
"title": "Rio",
"android": {"payload": {"sound": "false","badge": "1"}},
"ios": {"payload": {"sound": "true","badge": "1}}
}
}
Any idea to fix this issue would be a great help!
Hey, i'm new to ionic and i'm looking for a new way to do tests. How do you test the screen positioning? Is it possible to use protractor to test ionic apps or do you recommend another one?
Thanks!
t
My question is if there is a place for a commercial marketplace for web components? Will this encourage the creation and the usage of web components? Something similar with Ionic Marketplace but for web component created using Stencil, Angular Elements or other tools?
What is your recommendation to send push Notification, I had used cordova-plugin-fcm but that plugin is not update since 9 months ago, otherwise phonegap-plugin-push is recently updated with a great community.
I learnt how to use vim and used it for developing software (small projects). I have this notion that vim will not go a long way in developing large products, the way other text editors like VScode or atom would. I want to know what you think about this. And if you have any advice for me on using vim for producing large software.
Just got myself a Moto 360 and I was wondering if I can whip up an Ionic app for it instead of having to go native?
hi, please help me to Create a space for a member association website with ionic .
thank you in advance
Would you date me?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.