Tutorial by Examples: co

Components will render in their respective selector, so you can use that to nest components. If you have a component that shows a message: import { Component, Input } from '@angular/core'; @Component({ selector: 'app-required', template: `{{name}} is required.` }) export class RequiredC...
The model view controller is a very common design pattern that has been around for quite some time. This pattern focuses on reducing spaghetti code by separating classes into functional parts. Recently I have been experimenting with this design pattern in Unity and would like to lay out a basic exam...
Use the following flowchart to choose the right Collection for the job. This flowchart was based off [http://i.stack.imgur.com/aSDsG.png).
Choosing which C++ Container to use can be tricky, so here's a simple flowchart to help decide which Container is right for the job. This flowchart was based on Mikael Persson's post. This little graphic in the flowchart is from Megan Hopkins
Defined within Another Class C++ Nested Class[ref] (needs a reference to enclosing class) class Outer { class Inner { public: Inner(Outer* o) :outer(o) {} private: Outer* outer; }; }; Java [non-static] Nested Class (aka Inner Class or Member Class...
C++ & Java are both object-oriented languages, thus the following diagram applies to both.
This example shows how to to display specific property in dropdown but bind with the whole object. autocomplete-overview-example.html: <md-input-container> <input mdInput placeholder="State" [(ngModel)]="selection" [mdAutocomplete]="auto" [formCo...
data.service.ts: import { Injectable } from '@angular/core'; import { Http } from '@angular/http'; import 'rxjs/add/operator/map'; @Injectable() export class DataService { constructor(private http: Http) { } fetchData(){ return this.http.get('https://dinstruct-d4b62.firebaseio....
This example requires FormsModule and ReactiveFormsModule. Please import them in your application/module. import {FormsModule, ReactiveFormsModule} from '@angular/forms'; input-form-example.html <form class="example-form" (ngSubmit)="submit(addForm.value)" [formGroup]=&qu...
This example requires FormsModule and ReactiveFormsModule. Please import them in your application/module. import {FormsModule, ReactiveFormsModule} from '@angular/forms'; autocomplete-overview-example.html: <md-input-container> <input mdInput placeholder="State" [mdAutocom...
Add a new Swift file to your Xcode project. Name it as you please and you should get an alert box asking if you would like to create a bridging header. Note: If you don’t receive a prompt to add a bridging header, you probably declined this message once before and you will have to add the header m...
Create a Redux store with createStore. import { createStore } from 'redux' import todoApp from './reducers' let store = createStore(todoApp, { inistialStateVariable: "derp"}) Use connect to connect component to Redux store and pull props from store to component. import { connect } f...
The following is a guide on how to create an icon from material design icons: Load the icon font from Google CDN in your index.html:<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> Alternatively, you may import it in your styles.c...
This example shows how to use SVG icons in your app. Download the SVG iconset / icon (in this case, we're getting the icons from https://materialdesignicons.com/getting-started. Save it under your assets folder or somewhere else which you can access with. In your app.module.ts, add th...
Code Group group = new Group(); group.setId(1); group.setName("Ke"); User user1 = new User(); user1.setId(2); user1.setName("Liu"); User user2 = new User(); user2.setId(3); user2.setName("Yue"); ...
Project build.gradle allprojects { repositories { jcenter() // Add this if you use Gradle 4.0+ google() // Add this if you use Gradle < 4.0 maven { url 'https://maven.google.com' } } } ext { archVersion = '1.0.0-alpha5' } Applic...
Extend your activity from this activity public abstract class BaseCompatLifecycleActivity extends AppCompatActivity implements LifecycleRegistryOwner { // We need this class, because LifecycleActivity extends FragmentActivity not AppCompatActivity @NonNull private final LifecycleRe...
Each UI component lifecycle changed as shown at image. You may create component, that will be notified on lifecycle state change: public class MyLocationListener implements LifecycleObserver { private boolean enabled = false; private Lifecycle lifecycle; public MyLocationListener(...
Sometime you will need to know, with 2 dates objects, if there are corresponding to the same date, or find which date is after the other. In Go, there is 4 way to compare dates: date1 == date2, returns true when the 2 are the same moment date1 != date2, returns true when the 2 are different mom...
Data item is stored in packed decimal format in COMP-3. Packed-decimal format means that each byte of storage (except for the low order byte) can contain two decimal numbers. The low-order byte contains one digit in the leftmost portion and the sign (positive or negative) in the rightmost portion. ...

Page 246 of 248