This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PipeTransform } from '@angular/core'; | |
import { DatePipe } from '@angular/common'; | |
import { CONFIG_LOCAL_TIMEZONE_SHIFT } from './../../environment'; | |
export class LocalDatePipe extends DatePipe implements PipeTransform { | |
transform(value: any, pattern: string = 'mediumDate'): string { | |
return super.transform(value + CONFIG_LOCAL_TIMEZONE_SHIFT, pattern); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Post Model | |
angular.module('MyApp') | |
.factory('PostModel', function(BaseModel) { | |
var PostModel = BaseModel( | |
'/posts/:id', | |
{ | |
id: '@id' | |
}, | |
{ | |
comments: 'CommentModel' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Post Model | |
angular.module('myApp') | |
.factory('Post', function($resource) { | |
var resource = $resource( | |
'/posts/:id', | |
{ | |
id: '@id' | |
}, | |
{ | |
'store': { method: 'POST' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BaseModel extends Eloquent { | |
public static function isJoined($query, $table) | |
{ | |
$joins = $query->getQuery()->joins; | |
if($joins == null) { | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myApp') | |
.factory('Traits', function() { | |
return { | |
apply: function (_class, _trait) { | |
_.each(_trait, function (method, name) { | |
_class.prototype[name] = method; | |
}); | |
} | |
} | |
}); |