Tutorial by Examples: e

@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...
The following code can be entered in a Tcl shell (tclsh), or into a script file and run through a Tcl shell: puts "Hello, world!" It gives the string argument Hello, world! to the command puts. The puts command writes its argument to standard out (your terminal in interactive mode) an...
The function angular.merge takes all the enumerable properties from the source object to deeply extend the destination object. The function returns a reference to the now extended destination object angular.merge(destination, source) Examples angular.merge({}, {}) // {} angular.merge({name...
The function angular.isDefined tests a value if it is defined angular.isDefined(someValue) This is the equivalent of performing value !== undefined; // will evaluate to true is value is defined Examples angular.isDefined(42) // true angular.isDefined([1, 2]) // true angular.isDefined(un...
The angular.isDate function returns true if and only if the object passed to it is of the type Date. angular.isDate(value) Examples angular.isDate("lone star") // false angular.isDate(new Date()) // true
The angular.isNumber function returns true if and only if the object or value passed to it is of the type Number, this includes +Infinity, -Infinity and NaN angular.isNumber(value) This function will not cause a type coercion such as "23" == 23 // true Examples angular.isNumber...
This code makes sure that all nested containers are always the same height. This is done by assuring that all nested elements are the same height as the containing parrent div. See working example: https://jsfiddle.net/3wwh7ewp/ This effect is achieved due to the property align-items being set to...
C++11 The type std::conditional in the standard library header <type_traits> can select one type or the other, based on a compile-time boolean value: template<typename T> struct ValueOrPointer { typename std::conditional<(sizeof(T) > sizeof(void*)), T*, T>::type vop; }...
tf get /all /recursive $/ Gets and replaces all files and directories from the last version available

Page 350 of 1191