Tutorial by Examples

[ServiceContract] public interface IBookService { [OperationContract] [WebGet] List<Book> GetBooksList(); [OperationContract] [WebGet(UriTemplate = "Book/{id}")] Book GetBookById(string id); [OperationContract] [WebInvoke(UriTemplate = &...
The .every method tests if all array elements pass a provided predicate test. To test all objects for equality, you can use the following code snippets. [1, 2, 1].every(function(item, i, list) { return item === list[0]; }); // false [1, 1, 1].every(function(item, i, list) { return item === list[0...
Object obj = new Object(); // Note the 'new' keyword Where: Object is a reference type. obj is the variable in which to store the new reference. Object() is the call to a constructor of Object. What happens: Space in memory is allocated for the object. The constructor Object() is call...
The CSS multi-column layout makes it easy to create multiple columns of text. Code <div id="multi-columns">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation...
The column-width property sets the minimum column width. If column-count is not defined the browser will make as many columns as fit in the available width. Code: <div id="multi-columns"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididun...
Simple Example (centering a single element) HTML <div class="aligner"> <div class="aligner-item">…</div> </div> CSS .aligner { display: flex; align-items: center; justify-content: center; } .aligner-item { max-width: 50%; /*for d...
This bidirectional mapping requires the mappedBy attribute on the OneToMany association and the inversedBy attribute on the ManyToOne association. A bidirectional relationship has both an owning and inverse side. OneToMany relationships can use join tables, so you have to specify an owning side. Th...
Getting List Items This example shows how to retrieve all list items and iterate through them. You can use the top parameter to request a certain number of results. You can also use the select parameter to select certain fields ($select=id, Title, uri). JavaScript function GetListItems(){ $...
@input is useful to bind data between components First, import it in your component import { Input } from '@angular/core'; Then, add the input as a property of your component class @Input() car: any; Let's say that the selector of your component is 'car-component', when you call the compone...
The @if control directive evaluates a given expression and if it returns anything other than false, it processes its block of styles. Sass Example $test-variable: true !default =test-mixin @if $test-variable display: block @else display: none .test-selector +test-mixin ...
Sass uses the colon (:) operator to assign values to variables. Example $foreColor: red; p { color: $foreColor; }
Sass supports the following standard arithmetic operators: OperatorDescription+Addition–Subtraction*Multiplication/Division%Remainder Examples p { font-size: 16px + 4px; // 20px } h3 { width: 2px * 5 + 12px; // 22px } h2 { width: 8px + (12px / 2) * 3; // 26px } Norm...
Sass supports all the usual comparison operators: <,>,==,!=,<=,>=. Examples (10px == 10) // Returns true ("3" == 3) // Returns false $padding: 10px; $padding <= 8px; // Returns false
HTML <div class="wrap"> <img src="http://lorempixel.com/400/200/" /> </div> CSS .wrap { height: 50px;/* max image height */ width: 100px; border: 1px solid blue; text-align: center; } .wrap:before { content:""; di...
A Button directive which accepts an @Input() to specify a click limit until the button gets disabled. The parent component can listen to an event which will be emitted when the click limit is reached via @Output: import { Component, Input, Output, EventEmitter } from '@angular/core'; @Component(...
To receive a file uploaded via an HTTP Post, you need to do the following: @RequestMapping( value = "...", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE ) public Object uploadFile( @RequestPart MultipartFile file ) { String fileNam...
To receive multiple files uploaded via a single HTTP Post, you need to do the following: @RequestMapping( value = "...", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE ) public Object uploadFile( @RequestPart MultipartFile[] files ) { ...
It is possible to upload multiple parts, each with a different name. For each part name, you will need one parameter annotated with @RequestPart, whose name matches the part name. To receive a file uploaded via an HTTP Post, you need to do the following: @RequestMapping( value = "...&quo...
If you want to convert the content of a part into a domain object (e.g. a User or Account or Address), then the process is very simple: It is possible to upload multiple parts, each with a different name. For each part name, you will need one parameter annotated with @RequestPart, whose name matche...
Creating a custom ImplicitNamingStrategy allows you to tweak how Hibernate will assign names to non-explicitly named Entity attributes, including Foreign Keys, Unique Keys, Identifier Columns, Basic Columns, and more. For example, by default, Hibernate will generate Foreign Keys which are hashed an...

Page 395 of 1336