Skip to content

Instantly share code, notes, and snippets.

View martonsagi's full-sized avatar

Márton Sági martonsagi

View GitHub Profile
<template>
<require from="./inline-view"></require>
<inline-view></inline-view>
</template>
@martonsagi
martonsagi / app.html
Created August 28, 2016 23:32
Inline template in custom aurelia component
<template>
<require from="./inline"></require>
<div class="container-fluid">
<h4 class="page-header">Inline template in custom component</h4>
<div class="form-group">
<label>Template:</label>
<input class="form-control" type="text" value.bind="customTemplate" />
</div>
@martonsagi
martonsagi / app.html
Created September 9, 2016 14:10
Global attach() handler for viewmodels
<template>
<require from="./extended-view"></require>
<div class="container-fluid">
<h4 class="page-header">Global attach() handler for viewmodels </h4>
<ul class="list-group">
<li class="list-group-item">
<compose view-model="./extended-view"></compose>
@martonsagi
martonsagi / app.html
Created September 9, 2016 21:00
Permission check on two routes with the same module
<template>
<div class="container-fluid">
<h4 class="page-header">Permission check on two routes with the same module</h4>
<a class="btn btn-primary" href="#/route1">Route #1</a>
<a class="btn btn-danger" href="#/route2">Route #2</a>
<div class="panel">
<div class="panel-body">
@martonsagi
martonsagi / app.html
Last active September 10, 2016 22:00
Update Aurelia binding when properties change
<template>
<require from="./car-list"></require>
<div class="container-fluid">
<h4 class="page-header">Cars: ${cars.length} | Counter: ${counter}</h4>
<car-list cars.bind="cars"></car-list>
</div>
</template>
@martonsagi
martonsagi / app.html
Created September 24, 2016 07:01
Aurelia - Accessing Custom Component Data/Methods with EventAggregator
<template>
<require from="component"></require>
<div repeat.for="item of components">
<label>${item.name}${item.id}</label>: <component id.bind="item.id"></component>
</div>
<hr>
<button class="btn btn-primary" click.delegate="SubmitData({id: 1})">Submit data for Component#1</button>
<hr>
<button class="btn btn-success" click.delegate="SubmitData({all: true})">Submit data for All Component</button>
@martonsagi
martonsagi / app.html
Last active December 3, 2018 11:49
Aurelia Pipeline Authorization Example
<template>
<require from="nav-bar"></require>
<nav-bar router.bind="router"></nav-bar>
<main>
<div class="page-host">
<router-view></router-view>
@martonsagi
martonsagi / app.html
Last active October 5, 2016 09:03
Aurelia HTML only element default values
<template>
<require from="./cust-elem.html"></require>
<cust-elem param1.bind="value1" param2.bind="value2"></cust-elem>
</template>
@martonsagi
martonsagi / app.html
Last active July 25, 2018 11:31
Dynamic custom components with Aurelia
<template>
<require from="./frame-slot"></require>
<require from="./frame-inline"></require>
<require from="./frame-innerhtml"></require>
<div class="panel panel-primary">
<div class="panel-heading">Slots</div>
<div class="panel-body">
<frame-slot>
@martonsagi
martonsagi / app.html
Last active December 29, 2016 10:09
Change list order in Aurelia
<template>
<require from="./list"></require>
<list items.bind="items"></list>
</template>