Skip to content

Instantly share code, notes, and snippets.

@dlukez
dlukez / GraphQL.sublime-syntax
Last active March 28, 2017 05:30
HTML w/ embedded AngularJS + GraphQL support (for Sublime Text 3)
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: GraphQL
file_extensions:
- graphql
- GraphQL
scope: source.graphql
contexts:
main:
/**
* Null-option directive for angular-ui/ui-select.
*
* Author: Daniel Zimmermann (Github: dlukez)
* Version: 0.1
* License: MIT
* URL: https://gist.github.com/dlukez/76ea5f42507ba2d810e5
* Usage/demo: http://plnkr.co/edit/hogYX0loQTb57Pw6RKe7
*/
angular.module('dz.ui-select.null-option', []).directive('nullOption', function () {
@dlukez
dlukez / ngTagsInput-restrictToMaxTags.js
Last active November 7, 2019 16:53
A directive that extends mbenford/ngTagsInput to hide the tags input when the max tags limit is been reached.
/**
* A directive to hide the tags input when the max tags limit is reached.
* Works with github.com/mbenford/ngTagsInput
*/
angular.module('dz.restrictToMaxTags', ['ngTagsInput']).directive( 'restrictToMaxTags', function () {
var KEY_BACKSPACE = 8
KEY_TAB = 9;
return {
require: 'ngModel',