Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,18 @@ section {
#directives-keypress textarea {
width: 100%;
height: 100px;
}

span[ui-currency] {
display:block;
}
/*** Currency ***/
.ui-currency-pos {
font-weight: bold;
}
.ui-currency-neg {
font-size: 125%;
}
.ui-currency-zero {
color: #000;
}
69 changes: 64 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://code.angularjs.org/1.0.1/angular-1.0.1.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/angular-ui/angular-ui/master/build/angular-ui.js"></script>
<!-- <script type="text/javascript" src="/angular-ui/build/angular-ui.js"></script> -->
<!-- <script type="text/javascript" src="/angular-ui/build/angular-ui.js"></script> -->
<script type="text/javascript" src="js/prettify.js"></script>
<script type="text/javascript" src="https://raw.github.com/petebacondarwin/angular-contrib/master/js/lib/jquery.maskedinput-1.3.js"></script>
<script type="text/javascript" src="http://ivaynberg.github.com/select2/select2-master/select2.js"></script>
Expand All @@ -20,7 +20,7 @@
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="https://raw.github.com/angular-ui/angular-ui/master/build/angular-ui.css" />
<!-- <link rel="stylesheet" type="text/css" href="/angular-ui/build/angular-ui.css" /> -->
<!-- <link rel="stylesheet" type="text/css" href="/angular-ui/build/angular-ui.css" /> -->
<link rel="stylesheet" type="text/css" href="css/prettify.css" />
<link rel="stylesheet" type="text/css" href="http://ivaynberg.github.com/select2/select2-master/select2.css" />
<link rel="stylesheet" type="text/css" href="http://craigsworks.com/projects/qtip_new/packages/nightly/jquery.qtip.css" />
Expand Down Expand Up @@ -54,6 +54,7 @@
<li><a href="#directives-select2">Select2</a></li>
<li><a href="#directives-showhide">Show / Hide / Toggle</a></li>
<li><a href="#directives-tinymce">TinyMCE</a></li>
<li><a href="#directives-currency">Currency</a></li>
</ul>
</li>
<li class="dropdown">
Expand Down Expand Up @@ -104,6 +105,7 @@ <h1>Global Defaults</h1>
</div>
</section>


<section id="directives-jq">
<div class="page-header">
<h1>jQuery Passthrough</h1>
Expand Down Expand Up @@ -337,7 +339,7 @@ <h1>Modal</h1>
<h3>What?</h3>
<p>Takes the twitter bootstrap modal and lets you assign an ng-model to it. You can open/close the modal any way you want: data-* attributes, or use elm.modal('show'), or whatever. The ng-model you give will always correspond to whether the modal is opened or not, and if you set it it will also change the modal.
<p>
<div id="myModal" class="modal hide fade" ui-modal ng-model="modalShown">
<div id="myModal" class="modal hide" ui-modal ng-model="modalShown">
<div class="modal-header"><h1>Modalin'!</h1></div>
<div class="modal-body">
<p>Cool beans, dude.</p>
Expand Down Expand Up @@ -485,13 +487,12 @@ <h3>How?</h3>
<div class="page-header">
<h1>TinyMCE</h1>
</div>
<p class="alert alert-error"><i class="icon-info-sign"></i> Demo disabled temporarily due to conflicts with other directives. Use at your own risk!</p>
<div class="row">
<div class="span6">
<h3>What?</h3>
<p>TinyMCE WYSIWYG integration</p>
<div class="well">
<textarea ng-model="tinymce"></textarea>
<textarea ui-tinymce="{theme:'simple'}" ng-model="tinymce"></textarea>
<h4>Output:</h4>
<p>{{tinymce}}</p>
</div>
Expand All @@ -515,6 +516,64 @@ <h3>How?</h3>
</div>


</section>

<section id="directives-currency" ng-controller="CurrencyCtrl">
<div class="page-header">
<h1>Currency</h1>
</div>
<div class="row">
<div class="span6">
<h3>What?</h3>
<p>Angular currencyFilter wrapper</p>
<div class="well">
<span ui-currency ng-model="nums.pos"></span>
<span ui-currency="{ symbol: '$', zero: 'my-zero-class'}" ng-model="nums.zero"></span>
<span ui-currency ng-model="nums.neg"></span>
</div>
</div>
<div class="span6">
<h3>Why?</h3>
<p>In angular, you are able to specify what the currency symbol is (however, you might not want to change it for localization).
This directive gives greater control over your currency elements by allowing you to set CSS styles based on the number's sign.
</p>
</div>
</div>
<div class="row">
<div class="span12">
<h3>How?</h3>
<p>This example shows how you can use <code>ui.config</code> for greater convenience. You can still pass the configuration as the expression (even in addition to <code>ui.config</code>).</p>
<pre class="prettyprint linenums" ng-non-bindable>
&lt;span ui-currency ng-model=&quot;nums.pos&quot;&gt;&lt;/span&gt;
&lt;span ui-currency=&quot;{ symbol: '$', zero: 'my-zero-class'}&quot; ng-model=&quot;nums.zero&quot;&gt;&lt;/span&gt;
&lt;span ui-currency ng-model=&quot;nums.neg&quot;&gt;&lt;/span&gt;

&lt;script&gt;
myModule.value(&#x27;ui.config&#x27;, {
currency: {
symbol: &#x27;USD$&#x27;,
}
});
&lt;/script&gt;
&lt;style&gt;
span[ui-currency] {
display:block;
}
.ui-currency-pos {
font-weight: bold;
}
.ui-currency-neg {
font-size: 125%;
}
.my-zero-class {
color: #000;
}
&lt;/style&gt;
</pre>
</div>
</div>


</section>

<section id="filters-length" ng-controller="LengthCtrl">
Expand Down
14 changes: 12 additions & 2 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
* demoApp - 1.0.0rc2
*/

var demoApp = angular.module('demoApp', ['ui'], function($routeProvider) {
});
var demoApp = angular.module('demoApp', ['ui'], function($routeProvider) {}).value('ui.config', {
currency: {
symbol: 'USD$'
}
});

demoApp.config(function($locationProvider) {
$locationProvider.hashPrefix('');
Expand Down Expand Up @@ -66,4 +69,11 @@ function UniqueCtrl($scope) {
];
}

function CurrencyCtrl($scope) {
$scope.nums = {
pos : 1000,
neg : -12345,
zero: 0
};
};
/* EOF */