Skip to content

Instantly share code, notes, and snippets.

View jcastellanos003's full-sized avatar

Julián Castellanos jcastellanos003

  • Medellin - Antioquia
View GitHub Profile
@jcastellanos003
jcastellanos003 / designer.html
Last active August 29, 2015 14:09
designer
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<polymer-element name="my-element">
<template>
//Variables globales en Javascript
var myVar; //undefined
var rootFolder = "//static/app/.."; //String
var numberOfQuots = 5; //int
var arr = []; //array
//with instance
var obj = new Object(); //instance new object
//simple function
function doSomething(){
//do something
...
}
//function with arguments
function doSomethingWithArgs( arg1, arg2 ){
//args could be undefined or defined type
...
//defined function
function doSomething(msg){
alert(msg);
}
//attach event for h1 elements
document.querySelector('h1').onclick = function () {
doSomething('h1: Event OnClick attached');
};
<div ng-app="App">
<div ng-controller="MainCtrl as vm">
<input type="text" ng-model="vm.customModel"/>
<div>
<span>Two way data-binding rocks: {{ vm.customModel }}</span>
</div>
</div>
</div>
angular
.module('App', [])
.controller('MainCtrl', function () {
var vm = this;
vm.customModel = 'Era gol de yepes';
});
//entity country
var Country = function ( id, name, president ) {
this.id = id;
this.name = name;
this.president = president;
};
// vim:ts=4:sts=4:sw=4:
/*!
*
* Copyright 2009-2012 Kris Kowal under the terms of the MIT
* license found at http://github.com/kriskowal/q/raw/master/LICENSE
*
* With parts by Tyler Close
* Copyright 2007-2009 Tyler Close under the terms of the MIT X license found
* at http://www.opensource.org/licenses/mit-license.html
* Forked at ref_send.js version: 2009-05-11
var EntitiesAPI = (function () {
//TODO
...
}());
//Module
var EntitiesAPI = (function () {
//configurations
var defineProperties = function (obj, key, value) {
var config = {
value: value,
writable: true,
enumerable: true
};
Object.defineProperty(obj, key, config);