<div ng-controller="FileController">
<input
type="file"
ng-model="model.file"
change="upload(model)"
/>
</div>
function FileController($scope, $resource) {
var Files = $resource('/files/:id', { id: "@id" });
angular.extend($scope, {
model: { file: null },
upload: function(model) {
Files.prototype.$save.call(model.file, function() {
// Handle server response
});
}
});
});
<image-editor
fit="none"
drop-target
over-class="drop-active"
ng-class="$ui.state()"
drop="$ui.state('loading')"
load="$ui.state('editing')"
ng-model="user.avatar"
></image-editor>
function LoginController($scope, httpAuth, requestQueue) {
angular.extend($scope, {
login: function() {
httpAuth.basic({
username: "nate",
password: "foobar"
});
requestQueue.flush();
}
});
}
<link rel="resource" name="Users" href="http://my.api/users" />
modelProvider.model('Users', {
$instance: {
avatar: function() {
return this.$links.avatar || '/img/avatar.png';
}
},
/* ... */
});
// <img ng-src="{{ user.avatar() }}" />
modelProvider.model('Users', {
/* ... */
$class: {
active: function() {
return this.all({ active: true })
}
}
});
// model('Users').active().then(function(result) { /* ... */ })
- Promise-based
- Binds domain logic to API URLs
- Smart PATCH requests
- Smart error handling
- (Almost) Hypermedia-compliant
Future
- Relationship linking and embedding
- Smart read/write-through caching
- Message-orientation
- Utilities
- Wrapper Modules
- Standalone Modules
function CarouselDemoController($scope) {
angular.extend($scope, {
deck: { interval: 5000, slides: [
{ image: "../img/cats/1.jpg", text: "First" },
{ image: "../img/cats/2.jpg", text: "Second" },
{ image: "../img/cats/3.jpg", text: "Third" },
{ image: "../img/cats/4.jpg", text: "Fourth" }
]}
});
}
<div ng-controller="CarouselDemoController">
<carousel interval="deck.interval">
<slide ng-repeat="slide in deck.slides" active="slide.active">
<img ng-src="{{ slide.image }}" style="margin:auto;">
<div class="carousel-caption">
<p>{{ slide.text }}
</div>
</slide>
</carousel>
</div>
function AccordionDemoController($scope) {
angular.extend($scope, {
cats: [
{ image: "../img/cats/1.jpg", text: "First" },
{ image: "../img/cats/2.jpg", text: "Second" },
{ image: "../img/cats/3.jpg", text: "Third" },
{ image: "../img/cats/4.jpg", text: "Fourth" }
]
});
}
<body ng-controller="AccordionDemoController">
<accordion close-others="true">
<accordion-group
heading="{{ cat.text }}"
ng-repeat="cat in cats"
>
<img ng-src="{{ cat.image }}" />
</accordion-group>
</accordion>
</body>
function Seriously($scope) {
$scope.myDate = new Date();
}
<div ng-controller="Seriously">
<div style="display:inline-block; min-height:290px;">
<div class="well well-sm" ng-model="myDate">
<datepicker show-weeks="false"></datepicker>
</div>
</div>
<div class="well well-sm" ng-model="myDate">
<timepicker show-meridian="true"></timepicker>
</div>
</div>
- Alerts
- Buttons
- Dropdowns
- Modals
- Progress Bars
- Pagination
- Ratings
- Tabs
- Tooltips
- Typeahead
http://angular-ui.github.io/bootstrap/
Others
- ui-slider
- ui-select
- ui-sortable
- ui-grid
- ui-map
- ui-codemirror / ui-ace
- ui-layout
- ...