npm i -g firebase-tools
| const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
| module.exports = function(paths) { | |
| return { | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.scss$/, |
| var trimCanvas = (function() { | |
| function rowBlank(imageData, width, y) { | |
| for (var x = 0; x < width; ++x) { | |
| if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) return false; | |
| } | |
| return true; | |
| } | |
| function columnBlank(imageData, width, x, top, bottom) { | |
| for (var y = top; y < bottom; ++y) { |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
Disclaimer 1: ΠΠ΅ΡΠ²ΡΡ ΠΊΠΎΡΠΎΡΠ°Ρ "ΠΏΡΠΎ ΡΠΎ ΡΠ΅Π³ΠΎ ΠΌΡ Π΄ΠΎΡΡΠΈΠ³Π»ΠΈ" Ρ ΡΠ°ΠΊΠΈ ΠΏΡΠΎΠΏΡΡΡΠΈΠ».
Disclaimer 2: ΠΠ½ΠΎΠ³ΠΈΠ΅ Π΄ΠΎΠΊΠ»Π°Π΄Ρ ΡΠΌΠΎΡΡΠ΅Π»ΠΈΡΡ ΠΈ ΠΎΡΡΡΡΡ ΠΏΠΈΡΠ°Π»ΠΈΡΡ Π² ΡΠΎΡΡΠΎΡΠ½ΠΈΠΈ Π°Π»ΠΊΠΎΠ³ΠΎΠ»ΡΠ½ΠΎΠ³ΠΎ ΠΎΠΏΡΡΠ½Π΅Π½ΠΈΡ.
Π‘Π΅ΠΉΡΠ°Ρ ΠΏΠΎΡΠΌΠΎΡΡΠ΅Π» Ben Alpert - What Lies Ahead ΠΎΠ½Π° ΠΏΡΠΎ ΡΠΎ ΠΊΠ°ΠΊΠΈΠ΅ ΠΈΠ΄Π΅ΠΈ ΠΎΠ½ΠΈ ΠΈΠΌΠ΅ΡΡ ΠΎ Π΄Π°Π»ΡΠ½Π΅ΠΉΡΠ΅ΠΌ ΡΠ°Π·Π²ΠΈΡΠΈΠΈ. Π ΠΎΠ½ΠΈ Π΄Π΅Π»ΡΡ Π½Π° UX-ΠΈΠ΄Π΅ΠΈ ΠΈ DX-ΠΈΠ΄Π΅ΠΈ. Π UX Ρ Π½ΠΈΡ :
| //Some of the examples use spread syntax available via Babel in ES7 proposal. | |
| //Live at: https://jsbin.com/zawavekepo/edit?js,console | |
| //Arrays, slicing and avoiding mutations | |
| const numArray = [10, 20, 30, 40, 50, 60]; | |
| const removeAtIndex = (arr, x) => { | |
| return [ | |
| ...arr.slice(0, x), | |
| ...arr.slice(x + 1) | |
| ]; |
| /* | |
| * modified from http://www.voidware.com/moon_phase.htm | |
| */ | |
| function getMoonPhase(year, month, day) | |
| { | |
| var c = e = jd = b = 0; | |
| if (month < 3) { | |
| year--; |
| /** | |
| * A generic confirmation for risky actions. | |
| * Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function | |
| */ | |
| angular.module('app').directive('ngReallyClick', [function() { | |
| return { | |
| restrict: 'A', | |
| link: function(scope, element, attrs) { | |
| element.bind('click', function() { | |
| var message = attrs.ngReallyMessage; |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
-
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
