var a = 1; a += 'foo'; a += 2; //--> a = '1foo2'
var a = new String('foo'); b = new String('bar');
a.up = function() {
return this.toString().toUpperCase()
};
a.up(); //--> FOO
b.up(); //--> Undefined
String.prototype.up = a.up;
b.up(); //--> BAR
var a = 1, b = function() { a++ };
b();
a; //--> 2
|
|
|
|
Les librairies "Ajax"
|
Les frameworks front-ends
|
Les frameworks MVC
|
Les librairies spécialisées
|
grunt.registerTask('server', [
'clean:server', 'coffee:dist', 'compass:server',
'livereload-start', 'connect:livereload', 'open', 'watch' ]);
grunt.registerTask('test', [
'clean:server', 'coffee', 'compass', 'connect:test', 'karma' ]);
grunt.registerTask('build', [
'clean:dist', 'jshint', 'test', 'coffee', 'compass:dist',
'useminPrepare', 'imagemin', 'cssmin', 'htmlmin', 'concat',
'copy', 'cdnify', 'ngmin', 'uglify', 'rev', 'usemin' ]);
<ul>
<li ng-repeat="contact in contacts" ng-click="click($index)">
{{contact.name}}
</li>
</ul>
<input type="text" ng-model="hello">
<p>{{hello}}</p>
<input type="text" ng-model="search">
<datagrid>
<line ng-repeat="contact in contacts | orderBy:'name' | filter:search">
</datagrid>
angular.module('myModule', ['myDependency'])
.factory('myService', function() { return myService })
.controller('myController', function($scope) { /* do stuff */ })
.directive('myDirective', function() { return { /* directive */ }});
angular.module('phonecat', [])
.config(function($routeProvider) {
$routeProvider
.when('/phones', {
templateUrl: 'partials/phone-list.html',
controller: PhoneListCtrl
})
.when('/phones/:phoneId', {
templateUrl: 'partials/phone-detail.html',
controller: PhoneDetailCtrl
})
.otherwise({redirectTo: '/phones'});
});
var User = $resource('/user/:userId', { userId: '@id' });
var user = User.get({ userId: 123 }, function() {
user.abc = true;
user.$save();
});
beforeEach(inject(function ($httpBackend) {
$httpBackend
.expectGET('/count')
.respond([1, 2, 3]);
}));
describe('myApp', function () {
it('should redirect index.html to index.html#/hello', function () {
browser().navigateTo('../../app/index.html');
expect(browser().location().url()).toBe('/hello');
});
});