Skip to content

Instantly share code, notes, and snippets.

View ryanabel03's full-sized avatar

Ryan Abel ryanabel03

  • Grand Rapids, MI
View GitHub Profile
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
selectSuperhero(pub, hero) {
this.attrs.selectSuperhero(hero, pub);
}
}
});
import Ember from 'ember';
export default Ember.Component.extend({
});
@ryanabel03
ryanabel03 / application-adapter.coffee
Created March 27, 2016 23:46
Ember.js Network Request Retries
ApplicationAdpater = DS.ActiveModelAdapter.extend
synchronizer: Em.inject.service()
ajax: (url, type, options) ->
hash = @ajaxOptions(url, type, options)
# set up hash.success & hash.error callbacks normally
@get('synchronizer').handleRequest(hash)
Teacup::Stylesheet.new :login_screen do
style :scroll_view,
width: '100%',
height: '100%',
autoresizingMask: UIAutoResizingFlexibleWidth | UIAutoResizingFlexibleHeight
style :table_view, extends: :flexible_margins
scrollEnabled: false,
separatorStyle: UITableViewSeparatorStyleSingleLine,
center_x: '50%',
class LoginViewController < UIViewController
include Objection::Compose
compose_with :login_table_view_model
#A stylesheet for all the styles in this controller
stylesheet :login_screen
def viewDidLoad
super
class LoginViewController < UIViewController
include Objection::Compose
#motion-objection for dependency injection!
compose_with :login_table_view_model
def viewDidLoad
super
# Create our table view controller and set various properties
@table_view_controller = UITableViewController.alloc.initWithStyle UITableViewStyleGrouped
[[[self.propertyA sendSomeInterestingMessage]
flattenMap:^RACStream *(SomeOtherObject *param1) {
return [self.someProperty someMessage:param1.property];
}]
subscribeError:^(NSError *error) {
[self.someRacSubject sendNext:nil];
}];