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
Update: Angular 1.1.5 added a ternary operator, so now we can simply write | |
<li ng-class="$first ? 'firstRow' : 'nonFirstRow'"> | |
If you are using an earlier version of Angular, your two choices are: | |
(condition && result_if_true || result_if_false) | |
{true: 'result_if_true', false: 'result_if_false'}[condition] | |
item 2. above creates an object with two properties. The array syntax is used to select either the property with name true or the property with name false, and return the associated value. | |
E.g., |
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
<!-- http://plnkr.co/edit/N98IKTcHoZMCs18FjSRF?p=preview --> | |
The directive assumes that the checkboxes array contains objects that have an isSelected property and a desc property. | |
<tri-state-checkbox checkboxes="listelements"></tri-state-checkbox> | |
or | |
<!-- http://plnkr.co/edit/PTnzedhD6resVkApBE9K?p=preview --> | |
If you prefer to have the directive only render the tri-stated checkbox, hence the individual checkboxes are in the HTML: | |
<tri-state-checkbox checkboxes="listelements" class="select-all-cb"> | |
</tri-state-checkbox>select all |
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
.checkbox { | |
width: 19px; | |
height: 25px; | |
padding: 0 5px 0 0; | |
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAABkCAYAAABkdwu1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB4VJREFUeNrsmVtvXNUVx9e5zOXMxY4vDElsTBwnk4sdxwFNSJS0qtSEBySoVKmtEEjtU8l3qIR4Q6IfoQ8VPPAQHpAoiIJLIFWahBaTluAkttMxk9iOPZn7/dz57z173DNO0IyDxQP1SEtzvM8+/1l777XXb69j6dSZF2irPjJt4WdLxVTPteT53mjej/sQ4+2qR4BdR2D9sAFYGKYI71uCNqwGy8NysDLMgDkbPWNCY7AEbAK2C+bf4J0JW4PdhM3AbgtRi/2Q1zPmUeL3r7zy2pkzZ2PrY3JdPg4Hv23j2rZduvDJ3zJv/flPf0RzRRjv4hXrYx49nXgmVqpUIdIUsl0HQi4Xs2yHDNOm0fjhQfSdhF2H3RWeWV4xNsydfjZ8PMREXHjBVRyXm2Tb5NQbZNfZtNFO2A4xFTqbu40LEHCdBp6DR5ZDloOHbeYZxGGNhk7VWo10nc05acJ8rUXyivGGTDZPpmWRaTIzybJsbuxaNwwuaFlWK0ZVYW1i6/FVrta4UEPXyTCagkzcQpthGvwe81IItIWOujGKfT4VdyRMvsMXgFyHLxbvLeFbktFud9wBrIcZDYfINEyS8bQkSaQqMvmwTrbNhuvjQ2RzKmLOEgHresXYH1UWkJo/AAckPIw++FZkBQHUXAC+EPa6VxnxzLqg7BErsMj+58yXWX/AT8yCWoBCWpBCYY0i8DgSCVNvbw8lk8miiP6M8JCLSSKfsYlkgXgAdkIEJNtOQTHBsmc7ZYQQ2043YCtivza8w6yITux7FtYr4kgRRmJIVSHI9mhWBKzlzRquaMwJsbsisn |
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
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content="This is an example page"> |
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
/* http://www.cowboycoded.com/2011/04/08/customizing-your-embedded-gists-with-css/ */ | |
/* Line numbers column background has been made white and font size has been decreased in code */ | |
.gist{ | |
margin: 15px 0 !important; | |
} | |
.gist-file{ | |
border: none !important; | |
} |
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
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
var json_Album_URI = "https://picasaweb.google.com/data/feed/base/" | |
+ "user/" + "dasarnab45" | |
+ "?alt=" + "json" | |
+ "&kind=" + "album" | |
+ "&hl=" + "en_US" |
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
var myModule = angular.module('myModule', []) | |
.directive('myComponent', function () { | |
return { | |
restrict:'E', | |
scope:{ | |
/* NOTE: Normally I would set my attributes and bindings | |
to be the same name but I wanted to delineate between | |
parent and isolated scope. */ | |
isolatedAttributeFoo:'@attributeFoo', | |
isolatedBindingFoo:'=bindingFoo', |
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
td { padding: 0.2em 1em; } | |
th { text-align: center; } | |
thead { | |
border-bottom: 2px solid black; | |
cursor: pointer; | |
} | |
/* http://www.greywyvern.com/code/php/binary2base64 */ | |
.sort-true { |
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
ContentPanel.ColumnDefinitions.Clear(); | |
ContentPanel.RowDefinitions.Clear(); | |
int numColumnsToAdd = 4; | |
int numRowsToAdd = 4; | |
for (int column = 0; column < numColumnsToAdd; column++) | |
{ | |
ColumnDefinition cd = new ColumnDefinition(); | |
cd.Width = new GridLength(200); | |
ContentPanel.ColumnDefinitions.Add(cd); | |
} |
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
<!DOCTYPE html> | |
<html ng-app="app"> | |
<head> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body ng-controller="MyCtrl"> | |
{{serviceOutput}} | |
<br/><br/> |
OlderNewer