Skip to content

Instantly share code, notes, and snippets.

View frederikprijck's full-sized avatar

Frederik Prijck frederikprijck

View GitHub Profile
import { Component, OnInit, NgZone } from "@angular/core";
const firebase = require("nativescript-plugin-firebase");
import { AppService } from "./app.service";
@Component({
selector: "ns-app",
templateUrl: "./app.component.html"
ERROR: Error{rejection: undefined, promise: ZoneAwarePromise{__zone_symbol__state: 0, __zone_symbol__value: undefined}, zone: Zone{_properties: Object{ProxyZoneSpec: ...}, _parent: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, _name: 'Pr
oxyZone', _zoneDelegate: ZoneDelegate{_taskCounts: ..., zone: ..., _parentDelegate: ..., _forkZS: ..., _forkDlgt: ..., _forkCurrZone: ..., _interceptZS: ..., _interceptDlgt: ..., _interceptCurrZone: ..., _invokeZS: ..., _invokeDlgt: ..., _invokeCurrZone: ..., _
handleErrorZS: ..., _handleErrorDlgt: ..., _handleErrorCurrZone: ..., _scheduleTaskZS: ..., _scheduleTaskDlgt: ..., _scheduleTaskCurrZone: ..., _invokeTaskZS: ..., _invokeTaskDlgt: ..., _invokeTaskCurrZone: ..., _cancelTaskZS: ..., _cancelTaskDlgt: ..., _cancel
TaskCurrZone: ..., _hasTaskZS: ..., _hasTaskDlgt: ..., _hasTaskDlgtOwner: ..., _hasTaskCurrZone: ...}}, task: ZoneTask{_zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, runCount: 0, _zoneDelegates: null, _state:
var simpleGit = require('simple-git')();
module.exports = () => {
return Promise.all([
getRemoteUrl(),
getCurrentBranch(),
getLatestCommit()
]).then(res => {
return {
remote: res[0],
import {
inject,
TestBed
} from '@angular/core/testing';
import { AppComponent } from './app.container';
import { AppSandbox } from '../../core.sandbox';
import { Observable } from 'rxjs/Observable';
describe('App', () => {
class SurveyListController {
surveys: ISurvey[];
search$: Subject<string> = new Subject<string>();
// subject used to clean up the observable subscriptions.
private onDestroy$: Subject<any> = new Subject<any>();
/**
* hook in-to the Angular onInit event
// Filter
public class CorsFilter : ActionFilterAttribute
{
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
base.OnActionExecuted(filterContext);
var response = filterContext.RequestContext.HttpContext.Response;
// Add header to response
response.AddHeader("Access-Control-Allow-Origin", "*");
// OLD CODE WITH INLINE REMARKS
public class TestController : Controller
{
[HttpOptions]
public ActionResult Xlsx()
{
// Catches and authorises pre-flight requests for /data/xlsx from remote domains
// Remark: Don't touch Response / Request object directly inside the Controller
Response.AddHeader("Access-Control-Allow-Origin", "*");