Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit 75a9eda

Browse files
committed
Moving to ng-bind fixing submenus
1 parent 5c6efe2 commit 75a9eda

11 files changed

+125
-94
lines changed

public/modules/articles/views/create-article.client.view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h1>New Article</h1>
2121
<input type="submit" class="btn btn-default">
2222
</div>
2323
<div data-ng-show="error" class="text-danger">
24-
<strong>{{error}}</strong>
24+
<strong data-ng-bind="error"></strong>
2525
</div>
2626
</fieldset>
2727
</form>

public/modules/articles/views/edit-article.client.view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h1>Edit Article</h1>
2121
<input type="submit" value="Update" class="btn btn-default">
2222
</div>
2323
<div data-ng-show="error" class="text-danger">
24-
<strong>{{error}}</strong>
24+
<strong data-ng-bind="error"></strong>
2525
</div>
2626
</fieldset>
2727
</form>

public/modules/articles/views/list-articles.client.view.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ <h1>Articles</h1>
44
</div>
55
<div class="list-group">
66
<a data-ng-repeat="article in articles" data-ng-href="#!/articles/{{article._id}}" class="list-group-item">
7-
<small class="list-group-item-text">{{article.created | date:'medium'}} / {{article.user.displayName}}</small>
8-
<h4 class="list-group-item-heading">{{article.title}}</h4>
9-
<p class="list-group-item-text">{{article.content}}</p>
7+
<small class="list-group-item-text">Posted on <span data-ng-bind="article.created | date:'mediumDate'"></span> by <span data-ng-bind="article.user.displayName"></span></small>
8+
<h4 class="list-group-item-heading" data-ng-bind="article.title"></h4>
9+
<p class="list-group-item-text" data-ng-bind="article.content"></p>
1010
</a>
1111
</div>
12-
<div class="alert alert-warning text-center" data-ng-hide="!articles.$resolved || articles.length">
12+
<div class="alert alert-warning text-center" data-ng-if="articles.$resolved && !articles.length">
1313
No articles yet, why don't you <a href="/#!/articles/create">create one</a>?
1414
</div>
1515
</section>
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<section data-ng-controller="ArticlesController" data-ng-init="findOne()">
22
<div class="page-header">
3-
<h1>{{article.title}}</h1>
3+
<h1 data-ng-bind="article.title"></h1>
44
</div>
5-
65
<div class="pull-right" data-ng-show="authentication.user._id == article.user._id">
76
<a class="btn btn-primary" href="/#!/articles/{{article._id}}/edit">
87
<i class="glyphicon glyphicon-edit"></i>
@@ -12,9 +11,7 @@ <h1>{{article.title}}</h1>
1211
</a>
1312
</div>
1413
<small>
15-
<em class="text-muted">Posted on {{article.created | date:'mediumDate'}} by {{article.user.displayName}}</em>
14+
<em class="text-muted">Posted on <span data-ng-bind="article.created | date:'mediumDate'"></span> by <span data-ng-bind="article.user.displayName"></span></em>
1615
</small>
17-
<p class="lead">
18-
{{article.content}}
19-
</p>
16+
<p class="lead" data-ng-bind="article.content"></p>
2017
</section>

public/modules/core/services/menus.client.service.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ angular.module('core').service('Menus', [
8282
this.menus[menuId].items.push({
8383
title: menuItemTitle,
8484
link: menuItemURL,
85-
mClass: menuClass || '',
85+
menuClass: menuClass || '',
8686
uiRoute: menuItemUIRoute || ('/' + menuItemURL),
8787
isPublic: isPublic || this.menus[menuId].isPublic,
8888
roles: roles || this.defaultRoles,
89-
subitems: [],
89+
items: [],
9090
shouldRender: shouldRender
9191
});
9292

@@ -103,7 +103,7 @@ angular.module('core').service('Menus', [
103103
for (var itemIndex in this.menus[menuId].items) {
104104
if (this.menus[menuId].items[itemIndex].link === rootMenuItemURL) {
105105
// Push new submenu item
106-
this.menus[menuId].items[itemIndex].subitems.push({
106+
this.menus[menuId].items[itemIndex].items.push({
107107
title: menuItemTitle,
108108
link: menuItemURL,
109109
uiRoute: menuItemUIRoute || ('/' + menuItemURL),
@@ -141,9 +141,9 @@ angular.module('core').service('Menus', [
141141

142142
// Search for menu item to remove
143143
for (var itemIndex in this.menus[menuId].items) {
144-
for (var subitemIndex in this.menus[menuId].items[itemIndex].subitems) {
145-
if (this.menus[menuId].items[itemIndex].subitems[subitemIndex].link === submenuItemURL) {
146-
this.menus[menuId].items[itemIndex].subitems.splice(subitemIndex, 1);
144+
for (var subitemIndex in this.menus[menuId].items[itemIndex].items) {
145+
if (this.menus[menuId].items[itemIndex].items[subitemIndex].link === submenuItemURL) {
146+
this.menus[menuId].items[itemIndex].items.splice(subitemIndex, 1);
147147
}
148148
}
149149
}

public/modules/core/views/header.client.view.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@
1212
<ul class="nav navbar-nav" data-ng-if="menu.shouldRender(authentication.user);">
1313
<li data-ng-repeat="item in menu.items" data-ng-if="item.shouldRender(authentication.user);" ng-switch="item.mClass" class="{{item.mClass}}" ui-route="{{item.uiRoute}}" ng-class="{active: $uiRoute}">
1414
<a ng-switch-when="dropdown" href="#" class="dropdown-toggle" data-toggle="dropdown">
15-
{{item.title}}
16-
<b class="caret"></b>
17-
</a>
18-
<ul ng-switch-when="dropdown" class="dropdown-menu">
19-
<li data-ng-repeat="subitem in item.subitems" data-ng-if="subitem.shouldRender(authentication.user);" ui-route="{{subitem.uiRoute}}" ng-class="{active: $uiRoute}">
20-
<a href="/#!/{{subitem.link}}">{{subitem.title}}</a>
21-
</li>
22-
</ul>
23-
24-
<a ng-switch-default href="/#!/{{item.link}}">{{item.title}}</a>
15+
<span data-ng-bind="item.title"></span>
16+
<b class="caret"></b>
17+
</a>
18+
<ul ng-switch-when="dropdown" class="dropdown-menu">
19+
<li data-ng-repeat="subitem in item.items" data-ng-if="subitem.shouldRender(authentication.user);" ui-route="{{subitem.uiRoute}}" ng-class="{active: $uiRoute}">
20+
<a href="/#!/{{subitem.link}}" data-ng-bind="subitem.title"></a>
21+
</li>
22+
</ul>
23+
<a ng-switch-default href="/#!/{{item.link}}" data-ng-bind="item.title"></a>
2524
</li>
2625
</ul>
2726
<ul class="nav navbar-nav navbar-right" data-ng-hide="authentication.user">
@@ -36,8 +35,8 @@
3635
<ul class="nav navbar-nav navbar-right" data-ng-show="authentication.user">
3736
<li class="dropdown">
3837
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
39-
{{authentication.user.displayName}} <b class="caret"></b>
40-
</a>
38+
<span data-ng-bind="authentication.user.displayName"></span> <b class="caret"></b>
39+
</a>
4140
<ul class="dropdown-menu">
4241
<li>
4342
<a href="/#!/settings/profile">Edit Profile</a>
@@ -56,4 +55,4 @@
5655
</li>
5756
</ul>
5857
</nav>
59-
</div>
58+
</div>
Lines changed: 94 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,96 @@
11
<section data-ng-controller="HomeController">
22

3-
<div class="container">
4-
<div class="row clearfix">
5-
<div class="col-md-12 column">
6-
<div class="jumbotron">
7-
<h1>
8-
That's some<br><img alt="140x140" src="http://meanjs.org/img/logo.png" />
9-
</h1>
10-
<p>
11-
Open-Source Full-Stack Solution For MEAN Applications
12-
</p>
13-
<p>
14-
<a class="btn btn-primary btn-large" href="http://meanjs.org" target="_blank">Learn more</a>
15-
</p>
16-
</div>
17-
</div>
18-
</div>
19-
<h2>Congrats! You've configured and run the sample application.</h2>
20-
<p>MEAN.JS is a web application boilerplate. That means start changing everything :-)</p>
21-
<p>This sample application tracks users and articles. Click <em>Signup</em> to get started. To configure your app to work with your social accounts, edit the <em>/config/strategies/*.js</em> files.</p>
22-
<div id="techTable" class="row clearfix">
23-
<div class="col-md-3 column">
24-
<h2><em>M</em>ongoDB</h2>
25-
<p><a target="_blank" href="http://mongodb.org/">MongoDB</a> is a database. MongoDB's <a target="_blank" href="http://docs.mongodb.org/manual/">great manual</a>, to get started with NoSQL and MongoDB.</p>
26-
</div>
27-
<div class="col-md-3 column">
28-
<h2><em>E</em>xpress</h2>
29-
<p><a target="_blank" href="http://expressjs.com/"> Express</a> is an app server. Check out <a target="_blank" href="http://expressjs.com/guide.html">The Express Guide</a> or <a target="_blank" href="http://stackoverflow.com/questions/8144214/learning-express-for-node-js">StackOverflow</a> for more info.</p>
30-
</div>
31-
<div class="col-md-3 column">
32-
<h2><em>A</em>ngularJS</h2>
33-
<p>AngularJS is web app framework. <a target="_blank" href="http://angularjs.org/">Angular's webiste</a> offers alot. The <a target="_blank" href="http://www.thinkster.io/">Thinkster Popular Guide</a> and <a target="_blank" href="https://egghead.io/">Egghead Videos</a> are great resources.</p>
34-
</div>
35-
<div class="col-md-3 column">
36-
<h2><em>N</em>ode.js</h2>
37-
<p><a target="_blank" href="http://nodejs.org/">Node.js</a> is a web server. Node's website and this <a target="_blank" href="http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js">stackOverflow thread</a>, are great resources.</p>
38-
</div>
39-
</div>
40-
<br>
41-
<div class="well">
42-
<h2>MEAN.JS Documentation</h2>
43-
<p>
44-
Once you're familiar with the foundation technology, check out the MEAN.JS Documentation:
45-
<ul>
46-
<li><a target="_blank" href="http://meanjs.org/docs.html">MEAN.JS Documentation</a></li>
47-
<li><a target="_blank" href="http://meanjs.org/generator.html">Yoeman Generator</a></li>
48-
<li><a target="_blank" href="http://meanjs.org/modules.html">Modules</a></li>
49-
<li><a target="_blank" href="http://meanjs.org/changelog.html">Changelog</a></li>
50-
<li><a target="_blank" href="http://meanjs.org/community.html">Community</a></li>
51-
<li><a target="_blank" href="http://blog.meanjs.org">Blog</a></li>
52-
</ul>
53-
</p>
54-
</div>
55-
<br>Enjoy &amp; Keep Us Updated,
56-
<br>The MEAN.JS Team.
57-
<br>
58-
<br>
59-
<br>
60-
</div>
61-
</section>
3+
<div class="container">
4+
<div class="row clearfix">
5+
<div class="col-md-12 column">
6+
<div class="jumbotron text-center">
7+
<h1>
8+
<img alt="140x140" src="http://meanjs.org/img/logo.png" />
9+
</h1>
10+
<p>
11+
Open-Source Full-Stack Solution For MEAN Applications
12+
</p>
13+
<p>
14+
<a class="btn btn-primary btn-lg" href="http://meanjs.org" target="_blank">Learn more</a>
15+
</p>
16+
</div>
17+
</div>
18+
</div>
19+
<h2>Congrats! You've configured and run the sample application.</h2>
20+
<p>MEAN.JS is a web application boilerplate, which means you should start changing everything :-)</p>
21+
<p>This sample application tracks users and articles.</p>
22+
<ul>
23+
<li>
24+
Click
25+
<em>Signup</em>
26+
to get started.
27+
</li>
28+
<li>
29+
Configure your app to work with your social accounts, by editing the
30+
<em>/config/env/*.js</em>
31+
files.
32+
</li>
33+
<li>
34+
Edit your users module.
35+
</li>
36+
<li>
37+
Add new CRUD modules.
38+
</li>
39+
<li>
40+
Have fun...
41+
</li>
42+
</ul>
43+
<div id="techTable" class="row clearfix">
44+
<div class="col-md-3 column">
45+
<h2>
46+
<strong>M</strong>ongoDB
47+
</h2>
48+
<p><a target="_blank" href="http://mongodb.org/">MongoDB</a> is a database. MongoDB's <a target="_blank" href="http://docs.mongodb.org/manual/">great manual</a>, to get started with NoSQL and MongoDB.</p>
49+
</div>
50+
<div class="col-md-3 column">
51+
<h2>
52+
<strong>E</strong>xpress
53+
</h2>
54+
<p><a target="_blank" href="http://expressjs.com/"> Express</a> is an app server. Check out <a target="_blank" href="http://expressjs.com/guide.html">The Express Guide</a> or <a target="_blank" href="http://stackoverflow.com/questions/8144214/learning-express-for-node-js">StackOverflow</a> for more info.</p>
55+
</div>
56+
<div class="col-md-3 column">
57+
<h2>
58+
<strong>A</strong>ngularJS
59+
</h2>
60+
<p>AngularJS is web app framework. <a target="_blank" href="http://angularjs.org/">Angular's webiste</a> offers alot. The <a target="_blank" href="http://www.thinkster.io/">Thinkster Popular Guide</a> and <a target="_blank" href="https://egghead.io/">Egghead Videos</a> are great resources.</p>
61+
</div>
62+
<div class="col-md-3 column">
63+
<h2>
64+
<strong>N</strong>ode.js
65+
</h2>
66+
<p><a target="_blank" href="http://nodejs.org/">Node.js</a> is a web server. Node's website and this <a target="_blank" href="http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js">stackOverflow thread</a>, are great resources.</p>
67+
</div>
68+
</div>
69+
<br>
70+
<div class="well">
71+
<h2>MEAN.JS Documentation</h2>
72+
<p>
73+
Once you're familiar with the foundation technology, check out the MEAN.JS Documentation:
74+
<ul>
75+
<li><a target="_blank" href="http://meanjs.org/docs.html">MEAN.JS Documentation</a>
76+
</li>
77+
<li><a target="_blank" href="http://meanjs.org/generator.html">Yoeman Generator</a>
78+
</li>
79+
<li><a target="_blank" href="http://meanjs.org/modules.html">Modules</a>
80+
</li>
81+
<li><a target="_blank" href="http://meanjs.org/changelog.html">Changelog</a>
82+
</li>
83+
<li><a target="_blank" href="http://meanjs.org/community.html">Community</a>
84+
</li>
85+
<li><a target="_blank" href="http://blog.meanjs.org">Blog</a>
86+
</li>
87+
</ul>
88+
</p>
89+
</div>
90+
<br>Enjoy &amp; Keep Us Updated,
91+
<br>The MEAN.JS Team.
92+
<br>
93+
<br>
94+
<br>
95+
</div>
96+
</section>

public/modules/users/views/settings/change-password.client.view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h3 class="col-md-12 text-center">Change your password</h3>
2222
<strong>Password Changed Successfully</strong>
2323
</div>
2424
<div data-ng-show="error" class="text-center text-danger">
25-
<strong>{{error}}</strong>
25+
<strong data-ng-bind="error"></strong>
2626
</div>
2727
</fieldset>
2828
</form>

public/modules/users/views/settings/edit-profile.client.view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h3 class="col-md-12 text-center">Edit your profile</h3>
2626
<strong>Profile Saved Successfully</strong>
2727
</div>
2828
<div data-ng-show="error" class="text-center text-danger">
29-
<strong>{{error}}</strong>
29+
<strong data-ng-bind="error"></strong>
3030
</div>
3131
</fieldset>
3232
</form>

public/modules/users/views/signin.client.view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ <h3 class="col-md-12 text-center">Or with your account</h3>
3131
<a href="/#!/signup">Sign up</a>
3232
</div>
3333
<div data-ng-show="error" class="text-center text-danger">
34-
<strong>{{error}}</strong>
34+
<strong data-ng-bind="error"></strong>
3535
</div>
3636
</fieldset>
3737
</form>

0 commit comments

Comments
 (0)