Skip to content

Commit abf7689

Browse files
committed
#172 Template hello-angularjs
1 parent 4386c16 commit abf7689

7 files changed

Lines changed: 150 additions & 0 deletions

File tree

‎org.nodeclipse.ui/src/org/nodeclipse/ui/util/Constants.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public class Constants {
3737
public static final String TEMPLATE_HELLO_COFFEE = "hello-coffee";
3838
public static final String TEMPLATE_HELLO_TYPESCRIPT = "hello-typescript";
3939
public static final String TEMPLATE_HELLO_HTML = "hello-html";
40+
// @since 0.18
41+
public static final String TEMPLATE_HELLO_ANGULARJS = "hello-angularjs";
4042
// @since 0.11
4143
public static final String TEMPLATE_HELLO_KOA = "hello-koa";
4244
public static final String TEMPLATE_HELLO_NASHORN = "hello-nashorn";

‎org.nodeclipse.ui/src/org/nodeclipse/ui/wizards/NodeProjectWizardPage.java‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public class NodeProjectWizardPage extends WizardPage {
4444
Button btnHelloCoffee;
4545
Button btnHelloTypeScript;
4646
Button btnHelloHtml;
47+
// @since 0.18
48+
Button btnHelloAngularjs;
4749
// @since 0.11
4850
Button btnHelloKoa;
4951
Button btnHelloNashorn;
@@ -221,6 +223,10 @@ private final void createTemplatesGroup(Composite parent) {
221223
btnHelloHtml = new Button(templatesGroup, SWT.RADIO);
222224
btnHelloHtml.setText(Constants.TEMPLATE_HELLO_HTML);
223225

226+
// @since 0.18
227+
btnHelloAngularjs = new Button(templatesGroup, SWT.RADIO);
228+
btnHelloAngularjs.setText(Constants.TEMPLATE_HELLO_ANGULARJS);
229+
224230
// @since 0.11
225231
btnHelloKoa = new Button(templatesGroup, SWT.RADIO);
226232
btnHelloKoa.setText(Constants.TEMPLATE_HELLO_KOA);
@@ -244,6 +250,9 @@ public String getSelectedTemplate() {
244250
if (btnHelloHtml.getSelection()) {
245251
return Constants.TEMPLATE_HELLO_HTML;
246252
}
253+
if (btnHelloAngularjs.getSelection()) {
254+
return Constants.TEMPLATE_HELLO_ANGULARJS;
255+
}
247256
if (btnHelloKoa.getSelection()) {
248257
return Constants.TEMPLATE_HELLO_KOA;
249258
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "app/bower_components"
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
var app = angular.module('MyTutorialApp',[]);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
<head>
3+
<title>Learning AngularJS</title>
4+
<script src="bower_components/angular/angular.min.js" type="text/javascript"></script>
5+
<script src="app.js" type="text/javascript"></script>
6+
<script src="maincontroller.js" type="text/javascript"></script>
7+
<body>
8+
<div id='content' ng-app='MyTutorialApp' ng-controller='MainController'>
9+
http://www.revillweb.com/tutorials/angularjs-in-30-minutes-angularjs-tutorial/
10+
</br>
11+
{{understand}}
12+
</br>
13+
14+
<input type='text' ng-model='inputValue' /></br>
15+
{{inputValue}}</br>
16+
17+
<select ng-model='selectedPerson' ng-options='obj.name for obj in people'></select>
18+
<!--
19+
<select ng-model='selectedGenre'>
20+
<option ng-repeat='musicLabel in people[selectedPerson.id].music'>{{musicLabel}}</option>
21+
</select>
22+
-->
23+
<select ng-model='selectedGenre' ng-options='musicLabel for musicLabel in people[selectedPerson.id].music'></select>
24+
</br>
25+
26+
<input type='text' ng-model='searchText' />
27+
<ul>
28+
<li ng-repeat='person in people | filter:searchText'>#{{person.id}} {{person.name}}</li>
29+
</ul>
30+
</br>
31+
32+
<input type='text' ng-model='searchText' /></br>
33+
Live :
34+
<ul>
35+
<li ng-repeat='person in people | filter:searchText' ng-show='person.live == true'>#{{person.id}} {{person.name}}</li>
36+
</ul>
37+
Hide not live :
38+
<ul>
39+
<li ng-repeat='person in people | filter:searchText' ng-hide='person.live == false'>#{{person.id}} {{person.name}}</li>
40+
</ul>
41+
</br>
42+
43+
Filter <input type='text' ng-model='searchText' />
44+
<ul>
45+
<li ng-repeat='person in people | filter:searchText' ng-show='person.live == true'>#{{person.id}} {{person.name}}</li>
46+
</ul>
47+
<input type='text' ng-model='newPerson' />
48+
<button ng-click='addNew()'>Add</button>
49+
50+
</div>
51+
</body>
52+
</html>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
app.controller("MainController", function($scope){
2+
$scope.understand = "I now understand how the scope works!";
3+
$scope.inputValue = "";
4+
5+
$scope.selectedPerson = 0;
6+
$scope.selectedGenre = null;
7+
$scope.people = [
8+
{
9+
id: 0,
10+
name: 'Leon',
11+
music: [
12+
'Rock',
13+
'Metal',
14+
'Dubstep',
15+
'Electro'
16+
],
17+
live: true
18+
},
19+
{
20+
id: 1,
21+
name: 'Chris',
22+
music: [
23+
'Indie',
24+
'Drumstep',
25+
'Dubstep',
26+
'Electro'
27+
],
28+
live: true
29+
},
30+
{
31+
id: 2,
32+
name: 'Harry',
33+
music: [
34+
'Rock',
35+
'Metal',
36+
'Thrash Metal',
37+
'Heavy Metal'
38+
],
39+
live: false
40+
},
41+
{
42+
id: 3,
43+
name: 'Allyce',
44+
music: [
45+
'Pop',
46+
'RnB',
47+
'Hip Hop'
48+
],
49+
live: true
50+
}
51+
];
52+
$scope.newPerson = null;
53+
$scope.addNew = function() {
54+
alert("new");
55+
if ($scope.newPerson != null && $scope.newPerson != "") {
56+
$scope.people.push({
57+
id: $scope.people.length,
58+
name: $scope.newPerson,
59+
live: true,
60+
music: []
61+
});
62+
}
63+
};
64+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "angularjs-in-30-minutes",
3+
"version": "0.0.0",
4+
"authors": [
5+
"Paul Verest <nodeclipse.org>"
6+
],
7+
"license": "MIT",
8+
"private": true,
9+
"ignore": [
10+
"**/.*",
11+
"node_modules",
12+
"bower_components",
13+
"test",
14+
"tests"
15+
],
16+
"dependencies": {
17+
"angular": "~1.3.0"
18+
}
19+
}

0 commit comments

Comments
 (0)