Add material to angular2-webpack-starter in three steps:
- Step 1
npm install --save @angular/material material hammerjs
- Step 2
| import { Pipe, PipeTransform } from '@angular/core'; | |
| /** | |
| * @Description Slug or lispCase; All letters are downCased and spaces and specialChars are replaced by hyphens '-'. | |
| * | |
| * EXAMPLE: {{ 'Your best days are not behind you; your best days are out in front of you.' | slug }} // your-best-days-are-not-behind-you-your-best-days-are-out-in-front-of-you | |
| * | |
| * @param {String} | |
| * @return {String} | |
| * */ |
npm install --save @angular/material material hammerjs
| import * as server from "./server"; | |
| new server.App |
| <?php | |
| function truncate($text, $chars = 25) { | |
| $text = $text." "; | |
| $text = substr($text,0,$chars); | |
| $text = substr($text,0,strrpos($text,' ')); | |
| $text = $text."..."; // Si no se desea tener tres puntos suspensivos se comenta esta línea. | |
| return $text; | |
| } |
| .directive('changeImg', [function () { | |
| return { | |
| restrict:'A', | |
| scope:{ | |
| imgA: '=', | |
| imgB: '=' | |
| }, | |
| link: function (scope, element) { | |
| element.mouseover(function(event){ |
| var fireData = { | |
| locations: {} | |
| }; | |
| // Create a synchronized array, and then destroy the synchronization after having the data | |
| var locations = $firebaseArray(FireRef.child('locations').orderByChild('left')); | |
| locations.$loaded() | |
| .then(function () { | |
| fireData.locations = angular.copy(locations); | |
| locations.$destroy(); |
| var Q = require('q'); | |
| var algoliasearch = require('algoliasearch'); | |
| var Firebase = require('firebase'); | |
| var _ = require('lodash'); | |
| var async = require('async'); | |
| var moment = require('moment'); | |
| var colors = require('colors'); | |
| var client = algoliasearch('················', '················································'); |
| Where i use $upload service | |
| var uploadFile = function(file,fileId){ | |
| var deferred = $q.defer(); | |
| file.upload = $upload.upload({ | |
| url: "/files", | |
| fields: { | |
| public_id: 'publications/'+fileId, | |
| upload_preset: 'ebdyaimw', |