This file contains hidden or 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> | |
<title>NG playground</title> | |
<script src="/build/angular.js"></script> | |
<style> | |
div {margin: 5px; padding: 0 10px 10px 10px; border: 1px solid black;} | |
input {width: 400px;} | |
</style> | |
</head> |
This file contains hidden or 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 src="http://code.angularjs.org/0.9.17/angular-0.9.17.js" ng:autobind></script> | |
<body> | |
<script> | |
function BookCntl() { | |
this.name = "BookCntl"; | |
} | |
This file contains hidden or 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://code.angularjs.org/0.9.16/angular-0.9.16.min.js" ng:controller="Main"> | |
<head> | |
<title>Simple Example of Angular's $xhr</title> | |
<script type="text/javascript" src="build/angular.js" ng:autobind></script> | |
<script type="text/javascript"> | |
function Main($xhr){ | |
var selft = this; | |
this.doRequest = function() { | |
$xhr('POST', 'url.php', 'data-content=233', function(code, response) { |
This file contains hidden or 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:controller="Main"> | |
<head> | |
<title ng:bind-template="Prefix: {{pageTitle}}"></title> | |
<script type="text/javascript" src="build/angular.js" ng:autobind></script> | |
<script type="text/javascript"> | |
function Main(){} | |
function Child(){} | |
</script> |
This file contains hidden or 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" src="http://code.angularjs.org/0.9.16/angular-0.9.16.min.js" ng:autobind></script> | |
<script type="text/javascript"> | |
angular.widget('my:test', function(element) { | |
// compile children elements ? | |
this.descend(true); | |
element.append('<button type="button" ng:click="testIt()">TEST</button>'); | |
}); | |
This file contains hidden or 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 src="http://code.angularjs.org/0.9.14/angular-0.9.14.js"></script> | |
</head> | |
<body> | |
<script> | |
// create element by jqLite | |
var s1 = angular.element('<script>') | |
.attr({type: 'text/javascript', src: 'http://code.angularjs.org/0.9.15/angular-0.9.15.js?param1'}); |
This file contains hidden or 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
// controller | |
function MyCtrl() { | |
this.instMethod = function() { | |
return this.$id; | |
}; | |
} | |
MyCtrl.prototype.protoMethod = function(index) { | |
return this.$id; | |
}; |
This file contains hidden or 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
describe('service-example', function() { | |
angular.service('notify', function(win) { | |
var msgs = []; | |
return function(msg) { | |
msgs.push(msg); | |
if (msgs.length == 3) { | |
win.alert(msgs.join("\n")); | |
msgs = []; | |
} |
This file contains hidden or 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://angularjs.org/ng/js/angular-debug.js" ng:autobind></script> | |
<script type="text/javascript"> | |
function testController() { | |
// init the value | |
this.options = {1: 'one', 2: 'two'}; | |
this.change = function() { |
This file contains hidden or 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 PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html xmlns:ng="http://angularjs.org"> | |
<head> | |
<script type="text/javascript" src="../angular.js/src/angular-bootstrap.js" ng:autobind></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
angular.markup('---', function(text, textNode, parentElement) { | |
var compiler = this; |
NewerOlder