-
-
Save elalaouifaris/6bf49188508c980ebfd5 to your computer and use it in GitHub Desktop.
AngularJS Workshop
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
// module 1 | |
export const sqrt = Math.sqrt; | |
export function square(x) { | |
return x * x; | |
} | |
export function diag(x, y) { | |
return sqrt(square(x) + square(y)); | |
} | |
// importing from module 1 : named | |
import { square, diag } from 'lib'; | |
console.log(square(11)); // 121 | |
console.log(diag(4, 3)); // 5 | |
// importing from module 1 : all with prefix | |
import * as lib from 'lib'; | |
console.log(lib.square(11)); // 121 | |
console.log(lib.diag(4, 3)); // 5 | |
// module 2 | |
export default function () { ··· } | |
// importing from module 2 | |
import myFunc from 'myFunc'; | |
myFunc(); | |
// module 3 | |
export default class { ··· } | |
// importing from module 3 | |
import MyClass from 'MyClass'; | |
const inst = new MyClass(); |
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
function Person() { | |
this.age = 0; | |
setInterval(function growUp() { | |
this.age++; | |
}, 1000); | |
} | |
var p = new Person(); | |
// --- | |
function Person(){ | |
this.age = 0; | |
setInterval(() => { | |
this.age++; | |
}, 1000); | |
} | |
var p = new Person(); |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>Nukomeet AngularJS 1.x Workshop</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.1.1/foundation.min.css" media="screen" title="no title" charset="utf-8"> | |
<style media="screen"> | |
body { | |
padding: 20px 20px; | |
} | |
</style> | |
</head> | |
<body> | |
<!-- content goes here --> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment