Skip to content
This repository was archived by the owner on Oct 5, 2020. It is now read-only.

Commit 144b64e

Browse files
author
Nishad Bakshi
committed
updated bower dependencies and refactored everything in routes.js from templates and controllers into components
1 parent 57b6e42 commit 144b64e

File tree

16 files changed

+166
-91
lines changed

16 files changed

+166
-91
lines changed

app/templates/bower.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"version": "0.0.0",
44
"dependencies": {
55
"jquery": "~2.1.4",
6-
"angular": "~1.4.4",
6+
"angular": "~1.5.x",
77
"angular-bootstrap": "^1.1",
8-
"angular-cookies": "~1.4.4",
9-
"angular-highlightjs": "~0.4.3",
10-
"angular-mocks": "~1.4.4",
11-
"angular-ui-router": "~0.2.15",
8+
"angular-cookies": "~1.5.x",
9+
"angular-highlightjs": "^0.6.1",
10+
"angular-mocks": "~1.5.x",
11+
"angular-ui-router": "^1.0.0",
1212
"angular-ui-tinymce": "~0.0.9",
13-
"angular-animate": "~1.4.4",
13+
"angular-animate": "~1.5.x",
1414
"ngtoast": "^2.0.0",
1515
"angular-x2js": "https://github.com/janmichaelyu/angular-x2js.git",
1616
"bootstrap": "~3.3.5",
1717
"font-awesome": "~4.6.0",
18-
"highlightjs":"~8.7.0",
18+
"highlightjs": "~8.7.0",
1919
"lodash": "~3.10.1",
2020
"ml-search-ng": "~0.2.0",
2121
"ml-utils": "withjam/ml-utils",
@@ -27,16 +27,19 @@
2727
},
2828
"overrides": {
2929
"angular-highlightjs": {
30-
"dependencies": {"angular" : ">1.0.8", "highlightjs":"~8.7.0"}
30+
"dependencies": {
31+
"angular": ">1.0.8",
32+
"highlightjs": "~8.7.0"
33+
}
3134
}
3235
},
3336
"devDependencies": {
34-
"angular-mocks": "~1.4.4",
37+
"angular-mocks": "~1.5.x",
3538
"sinon": "http://sinonjs.org/releases/sinon-1.16.1.js",
3639
"bardjs": "~0.1.8"
3740
},
3841
"private": true,
3942
"resolutions": {
40-
"angular": "~1.4.4"
43+
"angular": "~1.5.x"
4144
}
4245
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('app.create')
5+
.component('create', {
6+
bindings: {},
7+
controller: 'CreateCtrl',
8+
templateUrl: 'app/create/create.html'
9+
});
10+
11+
}());

app/templates/ui/app/create/create.html

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,105 +7,105 @@ <h2 class="col-sm-10">Create a Document</h2>
77
<div class="form-group">
88
<label class="col-sm-2 control-label">Name</label>
99
<div class="col-sm-10">
10-
<input type="text" class="form-control" placeholder="person's name" ng-model="ctrl.person.name">
10+
<input type="text" class="form-control" placeholder="person's name" ng-model="$ctrl.person.name">
1111
</div>
1212
</div>
1313
<div class="form-group">
1414
<label class="col-sm-2 control-label">About</label>
1515
<div class="col-sm-10">
16-
<textarea class="form-control" ui-tinymce="ctrl.editorOptions" ng-model="ctrl.person.about"></textarea>
16+
<textarea class="form-control" ui-tinymce="$ctrl.editorOptions" ng-model="$ctrl.person.about"></textarea>
1717
</div>
1818
</div>
1919
<div class="form-group">
2020
<label class="col-sm-2 control-label">Greeting</label>
2121
<div class="col-sm-10">
22-
<input type="text" class="form-control" ng-model="ctrl.person.greeting" placeholder="How this person should be greeted on login">
22+
<input type="text" class="form-control" ng-model="$ctrl.person.greeting" placeholder="How this person should be greeted on login">
2323
</div>
2424
</div>
2525
<div class="form-group">
2626
<label class="col-sm-2 control-label">Balance</label>
2727
<div class="col-sm-10">
28-
<input type="text" class="form-control" ng-model="ctrl.person.balance" placeholder="">
28+
<input type="text" class="form-control" ng-model="$ctrl.person.balance" placeholder="">
2929
</div>
3030
</div>
3131
<div class="form-group">
3232
<label class="col-sm-2 control-label">Picture</label>
3333
<div class="col-sm-10">
34-
<input type="text" class="form-control" ng-model="ctrl.person.picture" placeholder="">
34+
<input type="text" class="form-control" ng-model="$ctrl.person.picture" placeholder="">
3535
</div>
3636
</div>
3737
<div class="form-group">
3838
<label class="col-sm-2 control-label">Age</label>
3939
<div class="col-sm-10">
40-
<input type="text" class="form-control" ng-model="ctrl.person.age" placeholder="">
40+
<input type="text" class="form-control" ng-model="$ctrl.person.age" placeholder="">
4141
</div>
4242
</div>
4343
<div class="form-group">
4444
<label class="col-sm-2 control-label">Eye Color</label>
4545
<div class="col-sm-10">
46-
<input type="text" class="form-control" ng-model="ctrl.person.eyeColor" placeholder="">
46+
<input type="text" class="form-control" ng-model="$ctrl.person.eyeColor" placeholder="">
4747
</div>
4848
</div>
4949
<div class="form-group">
5050
<label class="col-sm-2 control-label">Gender</label>
5151
<div class="col-sm-1">
52-
<label class="radio-inline"><input type="radio" value="Female" ng-model="ctrl.person.gender" placeholder="">Female</label>
52+
<label class="radio-inline"><input type="radio" value="Female" ng-model="$ctrl.person.gender" placeholder="">Female</label>
5353
</div>
5454
<div class="col-sm-1">
55-
<label class="radio-inline"><input type="radio" value="Male" ng-model="ctrl.person.gender" placeholder="">Male</label>
55+
<label class="radio-inline"><input type="radio" value="Male" ng-model="$ctrl.person.gender" placeholder="">Male</label>
5656
</div>
5757
</div>
5858
<div class="form-group">
5959
<label class="col-sm-2 control-label">Company</label>
6060
<div class="col-sm-10">
61-
<input type="text" class="form-control" ng-model="ctrl.person.company" placeholder="">
61+
<input type="text" class="form-control" ng-model="$ctrl.person.company" placeholder="">
6262
</div>
6363
</div>
6464
<div class="form-group">
6565
<label class="col-sm-2 control-label">Email</label>
6666
<div class="col-sm-10">
67-
<input type="email" class="form-control" ng-model="ctrl.person.email" placeholder="">
67+
<input type="email" class="form-control" ng-model="$ctrl.person.email" placeholder="">
6868
</div>
6969
</div>
7070
<div class="form-group">
7171
<label class="col-sm-2 control-label">Phone</label>
7272
<div class="col-sm-10">
73-
<input type="text" class="form-control" ng-model="ctrl.person.phone" placeholder="">
73+
<input type="text" class="form-control" ng-model="$ctrl.person.phone" placeholder="">
7474
</div>
7575
</div>
7676
<div class="form-group">
7777
<label class="col-sm-2 control-label">Address</label>
7878
<div class="col-sm-10">
79-
<input type="text" class="form-control" ng-model="ctrl.person.address" placeholder="">
79+
<input type="text" class="form-control" ng-model="$ctrl.person.address" placeholder="">
8080
</div>
8181
</div>
8282
<div class="form-group">
8383
<label class="col-sm-2 control-label">Location</label>
8484
<div class="col-sm-5">
85-
<input type="text" class="form-control" ng-model="ctrl.person.location.latitude" placeholder="">
85+
<input type="text" class="form-control" ng-model="$ctrl.person.location.latitude" placeholder="">
8686
</div>
8787
<div class="col-sm-5">
88-
<input type="text" class="form-control" ng-model="ctrl.person.location.longitude" placeholder="">
88+
<input type="text" class="form-control" ng-model="$ctrl.person.location.longitude" placeholder="">
8989
</div>
9090
</div>
9191
<div class="form-group">
9292
<label class="col-sm-2 control-label">Tags</label>
9393
<div class="col-sm-10">
94-
<input type="text" ng-model="ctrl.newTag">
95-
<button class="add-feature btn btn-default btn-sm" ng-click="ctrl.addTag()">Add</button>
94+
<input type="text" ng-model="$ctrl.newTag">
95+
<button class="add-feature btn btn-default btn-sm" ng-click="$ctrl.addTag()">Add</button>
9696
</div>
9797
<div class="col-sm-10 col-sm-offset-2">
98-
<div class="tag btn btn-info" ng-repeat="tag in ctrl.person.tags">
98+
<div class="tag btn btn-info" ng-repeat="tag in $ctrl.person.tags">
9999
<span>{{tag}}</span>
100-
<span class="glyphicon glyphicon-remove-circle" ng-click="ctrl.removeTag($index)"></span>
100+
<span class="glyphicon glyphicon-remove-circle" ng-click="$ctrl.removeTag($index)"></span>
101101
</div>
102102
</div>
103103
</div>
104104
<div class="form-group">
105105
<label class="col-sm-2 control-label">Active</label>
106106
<div class="col-sm-1">
107107
<label class="checkbox">
108-
<input type="checkbox" ng-model="ctrl.person.isActive">
108+
<input type="checkbox" ng-model="$ctrl.person.isActive">
109109
</label>
110110
</div>
111111
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('app.detail')
5+
.component('detail', {
6+
bindings: {
7+
doc: '<'
8+
},
9+
controller: 'DetailCtrl',
10+
templateUrl: 'app/detail/detail.html'
11+
});
12+
13+
}());

app/templates/ui/app/detail/detail.controller.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
/* global X2JS,vkbeautify */
2-
(function () {
2+
(function() {
33
'use strict';
44
angular.module('app.detail')
5-
.controller('DetailCtrl', DetailCtrl);
5+
.controller('DetailCtrl', DetailCtrl);
66

7-
DetailCtrl.$inject = ['doc', '$stateParams'];
8-
function DetailCtrl(doc, $stateParams) {
7+
DetailCtrl.$inject = ['$stateParams'];
8+
9+
function DetailCtrl($stateParams) {
910
var ctrl = this;
1011

1112
var uri = $stateParams.uri;
13+
var doc = this.doc;
1214

1315
var contentType = doc.headers('content-type');
1416

@@ -27,20 +29,26 @@
2729
/* jscs: enable */
2830
} else if (contentType.lastIndexOf('text/plain', 0) === 0) {
2931
ctrl.xml = doc.data;
30-
ctrl.json = {'Document' : doc.data};
32+
ctrl.json = {
33+
'Document': doc.data
34+
};
3135
ctrl.type = 'text';
32-
} else if (contentType.lastIndexOf('application', 0) === 0 ) {
36+
} else if (contentType.lastIndexOf('application', 0) === 0) {
3337
ctrl.xml = 'Binary object';
34-
ctrl.json = {'Document type' : 'Binary object'};
38+
ctrl.json = {
39+
'Document type': 'Binary object'
40+
};
3541
ctrl.type = 'binary';
3642
} else {
3743
ctrl.xml = 'Error occured determining document type.';
38-
ctrl.json = {'Error' : 'Error occured determining document type.'};
44+
ctrl.json = {
45+
'Error': 'Error occured determining document type.'
46+
};
3947
}
4048

4149
angular.extend(ctrl, {
42-
doc : doc.data,
43-
uri : uri
50+
doc: doc.data,
51+
uri: uri
4452
});
4553
}
4654
}());

app/templates/ui/app/detail/detail.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
<div class="col-sm-8">
33
<uib-tabset type="pills">
44
<uib-tab active="true">
5-
<uib-tab-heading>{{ctrl.type | uppercase}}</uib-tab-heading>
5+
<uib-tab-heading>{{$ctrl.type | uppercase}}</uib-tab-heading>
66
<div class="col-sm-9 bottom-buffer">
7-
<json-explorer ng-if="ctrl.type==='json'" data="ctrl.json"></json-explorer>
8-
<pre ng-if="ctrl.type!=='json'" class="pre-xml">{{ctrl.xml}}</pre>
7+
<json-explorer ng-if="$ctrl.type==='json'" data="$ctrl.json"></json-explorer>
8+
<pre ng-if="$ctrl.type!=='json'" class="pre-xml">{{$ctrl.xml}}</pre>
99

10-
<a ng-if="ctrl.type==='binary'" target="_blank" ng-href="/v1/documents?uri={{ctrl.uri}}&transform=download" class="btn btn-default">Download</a>
10+
<a ng-if="$ctrl.type==='binary'" target="_blank" ng-href="/v1/documents?uri={{$ctrl.uri}}&transform=download" class="btn btn-default">Download</a>
1111
</div>
1212
</uib-tab>
13-
<uib-tab ng-if="ctrl.type!=='json'">
13+
<uib-tab ng-if="$ctrl.type!=='json'">
1414
<uib-tab-heading>JSON</uib-tab-heading>
1515
<div class="col-sm-9 bottom-buffer">
16-
<json-explorer data="ctrl.json"></json-explorer>
16+
<json-explorer data="$ctrl.json"></json-explorer>
1717
</div>
1818
</uib-tab>
19-
<uib-tab ng-if="ctrl.type==='json'">
19+
<uib-tab ng-if="$ctrl.type==='json'">
2020
<uib-tab-heading >XML</uib-tab-heading>
2121
<div class="col-sm-9">
22-
<pre class="pre-xml">{{ctrl.xml}}</pre>
22+
<pre class="pre-xml">{{$ctrl.xml}}</pre>
2323
</div>
2424
</uib-tab>
2525
</uib-tabset>
@@ -29,7 +29,7 @@
2929
<div class="panel panel-default">
3030
<div class="panel-heading">Similar</div>
3131
<div class="panel-body">
32-
<ml-similar uri="{{ctrl.uri}}" limit="5"></ml-similar>
32+
<ml-similar uri="{{$ctrl.uri}}" limit="5"></ml-similar>
3333
</div>
3434
</div>
3535
</div>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('app.login')
5+
.component('loginFull', {
6+
bindings: {},
7+
controller: 'LoginFullCtrl',
8+
templateUrl: 'app/login/login-full.html'
9+
});
10+
11+
}());
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="row">
22
<div class="col-md-6 col-md-offset-3">
33
<div class="jumbotron login-box">
4-
<login mode="horizonal" show-cancel="ctrl.showCancel" callback="ctrl.toState(user)"></login>
4+
<login mode="horizonal" show-cancel="$ctrl.showCancel" callback="$ctrl.toState(user)"></login>
55
</div>
66
</div>
77
</div>

app/templates/ui/app/login/login.controller.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
(function () {
1+
(function() {
22
'use strict';
33

44
angular.module('app.login')
55
.controller('LoginCtrl', LoginCtrl)
66
.controller('LoginFullCtrl', LoginFullCtrl);
77

88
LoginCtrl.$inject = ['$scope', 'loginService'];
9+
910
function LoginCtrl($scope, loginService) {
1011
var ctrl = this;
1112
angular.extend(ctrl, {
@@ -35,12 +36,15 @@
3536

3637
function callback(user) {
3738
if ($scope.callback && !loginService.loginError()) {
38-
$scope.callback({user: user});
39+
$scope.callback({
40+
user: user
41+
});
3942
}
4043
}
4144
}
4245

4346
LoginFullCtrl.$inject = ['$state', '$stateParams'];
47+
4448
function LoginFullCtrl($state, $stateParams) {
4549
var ctrl = this;
4650
angular.extend(ctrl, {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('app.root')
5+
.component('root', {
6+
bindings: {},
7+
controller: 'RootCtrl',
8+
templateUrl: 'app/root/root.html'
9+
});
10+
11+
}());

0 commit comments

Comments
 (0)