Monday, December 28, 2015

My First AngularJS Filter

I'm working on a web project which utilizes AngularJS and today I setup my first search filter on a list of items.

Dang it was simple!!!

The basics:

  1. A <select> list of items populated using a JSON data structure
  2. An <input> field used to filter the list


Here is the main article I used for setting this up: http://sarahbranon.com/post/69604997957/fun-with-angularjs-filters-part-1-the-filter. It has a lot of great information so read up!

Now that I've learned that, I can apply it to my mobile apps to filter the many "list-based mobile apps" I have built with Ionic and AngularJS. :)

Issues I ran into?

  • Initially the search filter was displaying more items than it should because it was filtering on any string that I was entering. It looked throughout the entire JSON structure to match that string.
    • FIX: pass a model which is an object instead of a string (About half way down Sarahs article)

<input ng-model="search">
<li ng-repeat="friend in friends | filter:{ name: search }">
  {{friend.name}}
</li>



Friday, October 2, 2015

My First Game

This was fun. And a nice little experiment.

I made my first cross-platform game using Phaser.io. It's a Flappy Bird clone called Jumpy Kangaroo. Here is a link:  http://onelink.to/pajd5s. Now available for Android, but it could be on the App Store soon too. I just need to do more testing with the screen variations first.

I did the basics and released it...hoping to add more to it as I go.

I could use an iPhone 5 or 5S sometime. My old iPhone 4 just doesn't cut it for testing out my new apps. I can't upgrade to the latest iOS either, which bites.


Monday, March 2, 2015

Ionic - Testing AngularJS http PUT in browser


I'm posting this because I don't recall having this issue before, but when running ionic serve to test my app in the local browser, I was unable to successfully execute a PUT to update a piece of content in my browser.

PUT was working fine in POSTMAN, so my CMS was configured properly.
GET's were working just fine, I was able to display content from a web service.

POST and PUT would not work. I would get an Error returned, but with no error message and status code of 0. Weird.

Then I eventually ran the app on my device and it worked just fine!!! Huh?!?!?  Yep, I executed the PUT and it worked ok.

At the time of this error/writing, I'm running Ionic 1.3.11

[UPDATE 01/13/2016] - I fixed this a long time ago, but though I should post the info. The problem was due to my server side configuration.

Adding the following for NGINX worked for me:

Access-Control-Allow-Origin: *