っていうところでいささかはまった話です。
なにやら以下のように書く必要があるようです。
$scope.$apply(function () { $scoep.anyProperty = 'hogehoge'; });$applyの引数には式を文字列としても渡せるみたいです。
$scope.$apply(function () { $scoep.anyProperty = 'hogehoge'; });$applyの引数には式を文字列としても渡せるみたいです。
var file = input.files[0]; var name = file.name; var reader = new FileReader(); reader.onloadend = function (e) { var data = e.target.result; if (!data) { return ; } socket.emit('upload', { name : name, data : data}); }; reader.readAsDataURL(file);
var imgStructure = img.split(','); var base64 = imgStructure[1]; fs.writeFile( './public/' + name, new Buffer(base64, 'base64'), function (err) { console.log(err); } );
socket.emit('notify', {url : publicUrl});
socket.on('notify', function (data) { console.log(data); $('#image001').attr('src', data.url); });
pod 'NSRails'
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. [NSRConfig defaultConfig].appURL = @"http://localhost:3000"; return YES; }
rails new nsrails_test_server rails g scaffold user name:string email:string passwd:string created_at:datetime updated_at:datetime
protect_from_forgery with: :null_session
#import "NSRails.h" @interface JpPluscNSRailsTestUser : NSRRemoteObject @property (nonatomic, strong) NSString* name; @property (nonatomic, strong) NSString* email; @property (nonatomic, strong) NSString* passwd; @property (nonatomic, strong) NSString* gender; @end
+ (NSString *) remoteModelName { return @"user"; } + (NSString *) remoteControllerName { return @"users"; } @end
//オブジェクト作成、永続化 user = [[JpPluscNSRailsTestUser alloc] init]; user.name = self.aName.text; user.email = self.aEmail.text; user.passwd = self.aPasswd.text; [user remoteCreateAsync:^(NSError *error) { if (error != nil) { NSLog(@"%@", error); } }]; //取得 [JpPluscNSRailsTestUser remoteAllAsync:^(NSArray *allRemote, NSError *error) { NSMutableArray *indexPaths = [NSMutableArray array]; NSInteger size = [allRemote count]; //画面レンダリングなど... }];