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
(function() { | |
'use strict'; | |
var workersModule = angular.module('App.Workers'); | |
workersModule.service('InsertDataWorker', [ | |
'$rootScope', | |
'$cordovaSQLite', | |
'WorkerBridge', | |
'LocalDB', |
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
function(signInDate, signOutDate, PauseOptions, PauseOptionId, isSignInTimeSelected, isSignOutTimeSelected) { | |
// Calculate number of hours employee has worked for | |
var signInDate = new Date(signInDate), | |
signOutDate = new Date(signOutDate), | |
signInOffset = isSignInTimeSelected ? 0 : signInDate.getTimezoneOffset() * 60 * 1000, | |
signOutOffset = isSignOutTimeSelected ? 0 : signOutDate.getTimezoneOffset() * 60 * 1000, | |
diff = signOutDate - signInDate + signOutOffset - signInOffset, | |
pause = 0, | |
workingMinutes, | |
workingHours, |
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
var fs = require('fs'); | |
var mapFilePath = './classes-map.json'; | |
var filesToReplace = [ | |
{ path: './main.css', rename: './main-rename.css', type: 'css'}, | |
{ path: './index.html', rename: './index-rename.html', type: 'html'}, | |
{ path: './scripts.js', rename: './scripts-rename.js', type: 'js'} | |
]; |
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
@Component({ | |
selector: 'product', | |
template: `Product details` | |
}) | |
export class ProductComponent{ | |
constructor( | |
private store: Store<AppStore>, | |
private httpService: HttpService | |
){} | |
} |
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
@NgModule({ | |
declarations: [ | |
AppComponent, | |
], | |
imports: [ | |
// Angular core dependencies | |
BrowserModule, | |
HttpModule, | |
// Http service |
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
export abstract class Sandbox { | |
protected loggedUser$ = this.appState$.select(store.getLoggedUser); | |
constructor(protected appState$: Store<store.State>) {} | |
/** | |
* Returns complete or partial state from the store | |
* | |
* @param store | |
* @param property |
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
@Injectable() | |
export class AuthSandbox extends Sandbox { | |
public loginLoading$ = this.appState$.select(store.getLoginLoading); | |
public loginLoaded$ = this.appState$.select(store.getLoginLoaded); | |
public passwordRecoveryLoading$ = this.appState$.select(store.getPasswordRecoveryLoading); | |
public passwordRecoveryLoaded$ = this.appState$.select(store.getPasswordRecoveryLoaded); | |
constructor(protected appState$: Store<store.State>) { | |
super(appState$); |
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
export interface State { | |
products: fromProducts.State; | |
login: fromAuth.State; | |
} | |
const reducers = { | |
products: fromProducts.reducer, | |
login: fromAuth.reducer | |
}; |
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
@Effect() | |
doLogin$: Observable<Action> = this.actions$ | |
.ofType(actions.ActionTypes.DO_LOGIN) | |
.map((action: actions.DoLoginAction) => action.payload) | |
.switchMap(state => { | |
return this.authApiClient.login(state) | |
.map(user => new actions.DoLoginSuccessAction(new User(user))) | |
.catch(error => of(new actions.DoLoginFailAction())); | |
}); |
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
@Injectable() | |
@DefaultHeaders({ | |
'Accept': 'application/json', | |
'Content-Type': 'application/json' | |
}) | |
export class ProductsApiClient extends HttpService { | |
@PUT("/products/{id}") | |
public updateProductById(@Path("id") id: number, @Body product: Product): Observable<any> { return null; }; | |
} |
OlderNewer