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 | |
namespace Davzie\ProductCatalog\Entities; | |
use Validator; | |
use Input; | |
use Illuminate\Support\MessageBag; | |
use Exception; | |
use App; | |
class Base { |
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 { Component, Input, ElementRef } from '@angular/core'; | |
@Component({ | |
selector: 'app', | |
template: '<dynamic-component [componentName]="componentName"></dynamic-component>' | |
}) | |
export class AppComponent { | |
public componentName: string; |
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 { Component, Input, ViewChild, OnInit, ComponentFactoryResolver, ComponentFactory, ComponentRef } from '@angular/core'; | |
import { ViewContainerRef } from '@angular/core'; | |
import { SitesList } from './sites/sites-list.component'; | |
import { UserList } from './users/user-list.component' | |
const components = { | |
SitesList, | |
UserList | |
} |
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
interface Action<T> { | |
type: T; | |
} | |
interface PayloadAction<T, R> { | |
readonly type: T; | |
payload: R; | |
} | |
interface ActionFactory<T> { |
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
interface Action<T> { | |
type: T; | |
} | |
interface PayloadAction<T, R> { | |
readonly type: T; | |
payload: R; | |
} | |
interface ActionFactory<T> { |
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
describe('formPanel: FormFilterStore', function () { | |
it('Should generate new filters when formFilterChangeStream emits', function () { | |
jasmine.Clock.useMock(); | |
formFilterStore.currentFormFiltersStream.subscribe(function(filters){ | |
expect(filters.CQLFilter).toEqual('A new Cql Filter'); | |
expect(filters.APIFilter).toEqual('[A new Api filter]'); | |
}); |
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 { ComponentFixture, TestBed, async, inject, fakeAsync, flush } from '@angular/core/testing'; | |
import { | |
MatCheckboxModule, | |
MatSelectModule | |
} from '@angular/material'; | |
import { By } from '@angular/platform-browser'; | |
import { SelectMenuTestHelper } from './select-menu-test.helper'; | |
describe('SelectOptionComponent', () => { |
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
<EasyForm onsubmit="this.onFormSubmit"> | |
<label> | |
First name | |
<input name="firstName" /> | |
</label> | |
<label> | |
Last name | |
<input name="lastName" /> | |
</label> | |
<input name="newsletterSub" type="checkbox" /> |
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
class EasyForm extends React.Component { | |
fieldRefs = [] | |
fieldTypes = ['input', 'button', 'textarea']; | |
addRefsToChildren(children) { | |
let childPropsChildren; | |
const newChildren = React.Children.map(children, child => { | |
if (child.props && child.props.children ) { | |
childPropsChildren = this.addRefsToChildren(child.props.children); |
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 ComponentStateMachine extends ActionsSubject { | |
constructor() { | |
super(); | |
} | |
public next(action: any) { | |
// add all your state machine magic here .... | |
if (isValidAction) { | |
super.next(action); |
OlderNewer