Skip to content

Commit 3ac9b27

Browse files
committed
Commit #1
1 parent 96d5c5e commit 3ac9b27

15 files changed

+6541
-0
lines changed

index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Introduction</title>
5+
<meta charset="utf-8" />
6+
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
7+
<script src="node_modules/systemjs/dist/system.src.js"></script>
8+
<script>
9+
System.config({ packages: {"": {}}});
10+
System.import("primer").catch((err) => console.error(err));
11+
</script>
12+
</head>
13+
<body class="m-1">
14+
<h3>Introduction to the Javascript</h3>
15+
</body>
16+
</html>

modules/DuplicateName.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"use strict";
2+
var Name = (function () {
3+
function Name() {
4+
}
5+
Object.defineProperty(Name.prototype, "message", {
6+
get: function () {
7+
return "Another name and surname!";
8+
},
9+
enumerable: true,
10+
configurable: true
11+
});
12+
return Name;
13+
}());
14+
exports.Name = Name;

modules/DuplicateName.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export class Name {
2+
get message() {
3+
return "Another name and surname!";
4+
}
5+
}

modules/NameAndWeather.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"use strict";
2+
var Name = (function () {
3+
/*
4+
first: string;
5+
second: string;
6+
7+
constructor(first: string, second: string) {
8+
this.first = first;
9+
this.second = second;
10+
}
11+
*/
12+
function Name(first, second) {
13+
this.first = first;
14+
this.second = second;
15+
}
16+
Name.prototype.getMessage = function () {
17+
return "Hi, " + this.first + " " + this.second;
18+
};
19+
return Name;
20+
}());
21+
exports.Name = Name;
22+
var WeatherLocation = (function () {
23+
/*
24+
weather: string;
25+
city: string;
26+
27+
constructor(weather: string, city: string) {
28+
this.weather = weather;
29+
this.city = city;
30+
}
31+
*/
32+
function WeatherLocation(weather, city) {
33+
this.weather = weather;
34+
this.city = city;
35+
}
36+
WeatherLocation.prototype.getWeatherMessage = function () {
37+
return "Today, we have " + this.weather + " day, because we are in " + this.city;
38+
};
39+
return WeatherLocation;
40+
}());
41+
exports.WeatherLocation = WeatherLocation;

modules/NameAndWeather.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export class Name {
2+
/*
3+
first: string;
4+
second: string;
5+
6+
constructor(first: string, second: string) {
7+
this.first = first;
8+
this.second = second;
9+
}
10+
*/
11+
constructor(private first: string, private second: string) {}
12+
13+
getMessage() : string {
14+
return `Hi, ${this.first} ${this.second}`;
15+
}
16+
}
17+
18+
export class WeatherLocation {
19+
/*
20+
weather: string;
21+
city: string;
22+
23+
constructor(weather: string, city: string) {
24+
this.weather = weather;
25+
this.city = city;
26+
}
27+
*/
28+
constructor(private weather: string, private city:string) {}
29+
30+
getWeatherMessage() : string {
31+
return `Today, we have ${this.weather} day, because we are in ${this.city}`;
32+
}
33+
}

modules/NationalChinabank.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"use strict";
2+
var generalInfo = (function () {
3+
function generalInfo(title, budget, assets) {
4+
this.title = title;
5+
this.budget = budget;
6+
this.assets = assets;
7+
}
8+
generalInfo.prototype.getGeneralInfo = function () {
9+
return this.title + " which has " + this.budget + " with " + this.assets;
10+
};
11+
return generalInfo;
12+
}());
13+
exports.generalInfo = generalInfo;
14+
var generalActivity = (function () {
15+
function generalActivity(projects, income, investors) {
16+
this.projects = projects;
17+
this.income = income;
18+
this.investors = investors;
19+
}
20+
generalActivity.prototype.getActivityInfo = function () {
21+
return "The China National Bank has a few projects, such as: " + this.projects + ". This firm get a " + this.income + " income and attract " + this.investors + " as new investors.";
22+
};
23+
return generalActivity;
24+
}());
25+
exports.generalActivity = generalActivity;

modules/NationalChinabank.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export class generalInfo {
2+
constructor(title, budget, assets) {
3+
this.title = title;
4+
this.budget = budget;
5+
this.assets = assets;
6+
}
7+
8+
getGeneralInfo() {
9+
return `${this.title} which has ${this.budget} with ${this.assets}`;
10+
}
11+
}
12+
13+
export class generalActivity {
14+
constructor(projects, income, investors) {
15+
this.projects = projects;
16+
this.income = income;
17+
this.investors = investors;
18+
}
19+
20+
getActivityInfo() {
21+
return `The China National Bank has a few projects, such as: ${this.projects}. This firm get a ${this.income} income and attract ${this.investors} as new investors.`;
22+
}
23+
}

0 commit comments

Comments
 (0)