Skip to content

Instantly share code, notes, and snippets.

View anjmao's full-sized avatar

Andžej Maciusovič anjmao

  • CAST AI
  • Lithuania, Vilnius
View GitHub Profile
package main
import "fmt"
func main() {
languages := []Language{
Language{ID: 1, Name: "Javascript", Rating: 9},
Language{ID: 2, Name: "Golang", Rating: 9},
Language{ID: 3, Name: "Python", Rating: 8},
Language{ID: 4, Name: "Rust", Rating: 8},
package main
import "fmt"
type Language struct {
ID int
Name string
Rating int
}
const languages = [
{ id: 1, name: 'Javascript', rating: 9 },
{ id: 1, name: 'Golang', rating: 9 },
{ id: 1, name: 'Python', rating: 8 },
{ id: 1, name: 'Rust', rating: 8 },
{ id: 1, name: 'C#', rating: 7 },
{ id: 1, name: 'Java', rating: 5 }
];
const bestLanguages = languages.filter(x => x.rating > 8).map(x => x.name);
module: {
rules: [
{
test: /\.ts$/,
loader: ['awesome-typescript-loader', 'angular2-template-loader', 'ng-snippets-loader'],
exclude: [/node_modules\/(?!(ng2-.+))/],
},
{
test: /\.(html)$/,
loader: ['raw-loader', 'ng-snippets-loader']
---html,true
<ng-select [items]="items"
notFoundText="No results found"
typeToSearchText="Search for github account"
bindLabel="login"
[placeholder]="placeholder"
[multiple]="multiple"
[typeahead]="typeahead"
[(ngModel)]="githubAccount">
<ng-template ng-option-tmp let-item="item">
<h3>Multiselect example with custom template and typeahead</h3>
<pre>
<code class="html">
&lt;ng-select [items]="items"
notFoundText="No results found"
typeToSearchText="Search for github account"
bindLabel="login"
[placeholder]="placeholder"
[multiple]="multiple"
<pre>
<code class="html">
&lt;ng-select [items]="items"
notFoundText="No results found"
typeToSearchText="Search for github account"
bindLabel="login"
[placeholder]="placeholder"
[multiple]="multiple"
[typeahead]="typeahead"
[(ngModel)]="githubAccount"&gt;
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
});
<pre>
<code class="html">
<ng-select [items]="items"
notFoundText="No results found"
typeToSearchText="Search for github account"
bindLabel="login"
[placeholder]="placeholder"
[multiple]="multiple"
[typeahead]="typeahead"
[(ngModel)]="githubAccount">