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
"use strict"; | |
(function() { | |
Error.stackTraceLimit = -1; | |
var go$reservedKeywords = ["abstract", "arguments", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "eval", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield"]; | |
var go$global; | |
if (typeof window !== "undefined") { | |
go$global = window; |
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
// User Type | |
function User(name, id) { | |
this.name = name; | |
this.id = id; | |
this.save = function () { | |
DB.query('UPDATE User SET name = ? WHERE id = ?', this.name, this.id); | |
} | |
} |
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
// Namespace created within an IIFE for private scope | |
var user = (function () { | |
// Variable for holding the injected DB interface | |
var DB; | |
// User Type | |
function User(name, id) {/* ... */} | |
return { | |
// Expose a function for setting the DB interface |
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
package user | |
// Interface for a database result row | |
type DBRow interface { | |
GetInt(colnum int) int | |
GetString(colnum int) string | |
} | |
// Interface for a database result | |
type DBResult interface { |
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
// Simple class holding some configuration | |
class ConfigService{ | |
String text; | |
ConfigService() { | |
this.text = "Meep!"; | |
} | |
} | |
@NgDirective(selector: '[sample-text-id]') | |
class ReverseClickDirective{ |
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
import 'package:angular/angular.dart'; | |
main() { | |
ngBootstrap(); | |
// ... | |
} |
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
/* | |
* @NgFilter(name: 'myfilter') | |
* function MyFilter() {} | |
*/ | |
function MyFilter() {} | |
MyFilter.annotations = [new NgFilter({name: 'myFilter'})]; |
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
import 'dart:html'; | |
import 'package:angular/angular.dart'; | |
// Annotation which states that this class is a directive which should be | |
// attached to elements with a 'sample-text-id' attribute | |
@NgDirective(selector: '[sample-text-id]') | |
class ReverseClickDirective{ | |
// The element that the directive is attached to | |
Element element; |
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
<div id="sample_container_id"> | |
<p sample-text-id>Click me!</p> | |
</div> |
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
describe('click to reverse', function () { | |
var btn; | |
it('Reverses the button label on click', function () { | |
// load the page | |
browser.get('http://localhost:63342/protractorDemo/index.html'); | |
// Find the button | |
btn = element(by.binding('click.btnText')); |