Add material to angular2-webpack-starter in three steps:
- Step 1
npm install --save @angular/material material hammerjs
- Step 2
| 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', |
| 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('················', '················································'); |
| 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(); |
| .directive('changeImg', [function () { | |
| return { | |
| restrict:'A', | |
| scope:{ | |
| imgA: '=', | |
| imgB: '=' | |
| }, | |
| link: function (scope, element) { | |
| element.mouseover(function(event){ |
| <?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; | |
| } |
| import * as server from "./server"; | |
| new server.App |
npm install --save @angular/material material hammerjs
| 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} | |
| * */ |
| 'use strict'; | |
| angular.module('app',[ | |
| 'ngRoute', | |
| 'siteConfig', | |
| 'angular-loading-bar', | |
| 'filters', | |
| 'validators', | |
| 'firebase', | |
| 'routes', |
| #!/bin/bash | |
| sudo npm cache clean -f | |
| sudo npm install -g n | |
| sudo n stable | |
| if [[ ! -d "$NODE_PATH" ]]; then | |
| export NODE_PATH=/usr/local/lib/node_modules | |
| echo 'export NODE_PATH=/usr/local/lib/node_modules' >> ~/.bashrc | |
| fi |