This file contains hidden or 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
const loopback = require('loopback'); | |
module.exports = function(app) { | |
app.model( | |
loopback.Model.extend( | |
'LoginCredentials', | |
{ | |
id: false, | |
username: 'string', | |
password: 'string' |
This file contains hidden or 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
module.exports = function(app) { | |
app.models().forEach(Model => { | |
const original = Model.sharedClass.methods; | |
// Iterate over each model remote method | |
Model.sharedClass.methods = () => | |
original.call(Model.sharedClass).map(overwriteMethodProperties); | |
}); | |
app.emit('modelRemoted'); | |
}; |
This file contains hidden or 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
const join = require('path').join; | |
module.exports = { | |
'loopback-component-explorer': { | |
mountPath: '/explorer', | |
apiInfo: { | |
title: 'My App', | |
description: 'Test Explorer' | |
}, | |
uiDirs: [ | |
join(__dirname, '../explorer'), |
This file contains hidden or 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 { ReduxDevtoolsExtension, ReduxDevtoolsExtensionConnection } from '@ngrx/store-devtools/src/extension'; | |
import { RemoteDevToolsConnectionProxy } from './remote-devtools-connection-proxy' | |
import { connect } from 'remotedev/lib/devTools'; | |
export class RemoteDevToolsProxy implements ReduxDevtoolsExtension { | |
remotedev: any = null; | |
defaultOptions = { | |
realtime: true, | |
// Needs to match what you run `remotedev` command with and | |
// what you setup in remote devtools local connection settings |
This file contains hidden or 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 { ReduxDevtoolsExtensionConnection } from '@ngrx/store-devtools/src/extension'; | |
export class RemoteDevToolsConnectionProxy | |
implements ReduxDevtoolsExtensionConnection { | |
constructor(public remotedev: any, public instanceId: string) {} | |
subscribe(listener: (change: any) => void): any { | |
const listenerWrapper = (change: any) => { | |
listener(change); | |
}; |
This file contains hidden or 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 { NgModule } from '@angular/core'; | |
import { RemoteDevToolsProxy } from './remote-devtools-proxy'; | |
// ... | |
// Register our remote devtools if we're on-device and not in a browser | |
if (!window['devToolsExtension'] && !window['__REDUX_DEVTOOLS_EXTENSION__']) { | |
let remoteDevToolsProxy = new RemoteDevToolsProxy({ | |
connectTimeout: 300000, // extend for pauses during debugging | |
ackTimeout: 120000, // extend for pauses during debugging | |
secure: false // dev only |
This file contains hidden or 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
// Cascade delete for loopback | |
// https://gist.github.com/CjS77/44b2f75c0ec468f590d0 | |
/* jshint node:true */ | |
'use strict'; | |
/** | |
* There is an incubating feature to cascade the deletes to the relational tables. see | |
* https://github.com/strongloop/loopback-datasource-juggler/issues/88 | |
*/ |
NewerOlder