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 xmlns:ng="http://angularjs.org"> | |
<head> | |
<script type="text/javascript" src="http://code.angularjs.org/angular-0.9.8.js" ng:autobind></script> | |
<script type="text/javascript"> | |
function Controller() { | |
var self = this; | |
this.sizes = [{w:320, h:200},{w:640, h:480},{w:800, h:600}]; | |
this.rectangles = [ | |
{name:"alfa", size:{w:640, h:480}}, |
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 xmlns:ng="http://angularjs.org"> | |
<script type="text/javascript" ng:autobind src="http://code.angularjs.org/0.9.10/angular-0.9.10.js"></script> | |
<script> | |
function MyApp(){ | |
this.columns = ['name', 'description', 'amount']; | |
this.rows = [ | |
{name:'name 0', description:'desc 0', amount:123}, | |
{name:'name 1', description:'desc 1', amount:123}, | |
{name:'name 2', description:'desc 2', amount:123}, |
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.angularjs.org/angular-0.9.13.js" ng:autobind></script> | |
<script> | |
function MyCntrl() { | |
this.list_of_items = ['this', 'that', 'the other']; | |
this.foo = {choice:'that'}; | |
} | |
MyCntrl.prototype = { | |
loadData: function(){ |
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.angularjs.org/angular-0.9.13.js" ng:autobind></script> | |
<script> | |
function MyCntrl($defer) { | |
var self = this; | |
this.list_of_items = ['this', 'that', 'the other']; | |
self.foo = {choice:''}; | |
$defer(function(){ | |
self.foo = {choice:'that'}; |
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> | |
<body> | |
<form class="jsfiddle" method="post" action="http://jsfiddle.net/api/post/library/pure/" target="_blank"> | |
<textarea name="resources">http://code.angularjs.org/angular-0.10.5.min.js</textarea> | |
<textarea name="css"></textarea> | |
<input type="text" name="title" value="AngularJS Live Example"> | |
<textarea name="html"><div ng:app> | |
<div ng:controller="HelloCntl"> | |
Your name: <input type="text" ng:model="name" value="World"/> | |
<hr/> |
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 xmlns:ng="http://angularjs.org" ng:app> | |
<script src="http://docs-next.angularjs.org/angular-0.10.6.min.js"></script> | |
<script> | |
function MainCntl($route, $routeParams, $location) { | |
this.$route = $route; | |
this.$location = $location; | |
this.$routeParams = $routeParams; | |
$route.when('/Book/:bookId', {template: 'examples/book.html', controller: BookCntl}); |
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 ng-app> | |
<head> | |
<script type="text/javascript" src="http://code.angularjs.org/1.0.0rc12/angular-1.0.0rc12.min.js"></script> | |
<script> | |
function Test($scope, $location) { | |
$scope.away = 'away'; | |
} | |
</script> | |
</head> | |
<body ng-controller="Test"> |
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
When you go to bleeding edge you should change to: | |
@NgController { | |
selector: '[ng-controller=AppointmentCtrl]', | |
publishAs: 'ctrl' | |
} | |
class AppointmentCtrl { | |
String appointmentText = ''; | |
List appointments = [{'time': '08:00', 'title': 'Wake Up'}]; |
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
/** | |
* Zone is a mechanism for intercepting and keeping track of asynchronous work. | |
* | |
* A Zone is a global object which is configured with rules about how to intercept and keep track | |
* of the asynchronous callbacks. Zone has these responsibilities: | |
* | |
* 1. Intercept asynchronous task scheduling | |
* 2. Wrap callbacks for error-handling and zone tracking across async operations. | |
* 3. Provide a way to attach data to zones | |
* 4. Provide a context specific last frame error handling |
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
// https://gist.github.com/mhevery/4b1bdb59a8c16f9cbe76 | |
/// <reference path="probe.d.ts" /> | |
/////////////////////// | |
/// WORK IN PROGRESS // | |
/////////////////////// | |
var appRef: ApplicationRef = ng.platform.applications[0]; |