Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ngmin
Search
Hannes Stiebitzhofer
January 17, 2014
Programming
0
88
ngmin
Short presentation for first AngularJS Vienna meet up on April 17th, 2014.
Hannes Stiebitzhofer
January 17, 2014
Tweet
Share
More Decks by Hannes Stiebitzhofer
See All by Hannes Stiebitzhofer
FormulaJS
stiebitzhofer
0
160
Rails AngularJS Bower Heroku
stiebitzhofer
4
590
Other Decks in Programming
See All in Programming
Polars入門
daikikatsuragawa
1
160
Fragment Composition of GraphQL
quramy
13
1.4k
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
490
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
860
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
890
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
2
120
使ってみよう Azure AI Document Intelligence
kosmosebi
2
360
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
380
CREってこういうこと? 体験入社 - 提案資料 - / what-is-cre-trial-employment
shinden
1
460
Node.js v22 で変わること
yosuke_furukawa
PRO
11
3.9k
Let's learn code review
riofujimon
2
570
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
8
1.3k
Featured
See All Featured
Become a Pro
speakerdeck
PRO
12
4.6k
What's in a price? How to price your products and services
michaelherold
238
11k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
12
1.5k
Designing Experiences People Love
moore
136
23k
Producing Creativity
orderedlist
PRO
338
39k
Statistics for Hackers
jakevdp
790
220k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
Teambox: Starting and Learning
jrom
128
8.4k
Web development in the modern age
philhawksworth
203
10k
GitHub's CSS Performance
jonrohan
1025
450k
Happy Clients
brianwarren
92
6.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
22
1.6k
Transcript
AngularJS, April 17th, 2014 ! Hannes Stiebitzhofer
[email protected]
@stiebitzhofer ngmin
Angular does the magic via Dependency Injection var app =
angular.module("app", []); app.service("Store", function() { this.products = { item: "apple" }; }); app.controller("AppCtrl", function ($scope, Store) { $scope.products = Store.products; });
Minifying JS breaks everything! Error: Unknown provider: nProvider <- n
'Annotations' for names fixes the problem var app = angular.module('app',
[]); app.service('Store', function() { this.products = { item: 'apple' }; }); app.controller('AppCtrl', [ '$scope', 'Store', function ($scope, Store) { $scope.products = Store.products; } ]);
ngmin adds the annotations automatically Installation npm install -g ngmin
Command line usage ngmin somefile.js somefile.annotate.js Install for usage in grunt npm install grunt-ngmin --save-dev
Unfortunately global variables aren’t supported yet 'use strict'; var RabhApp
= angular.module(‚RabhApp' ['ngResource', ‚ngRoute']); ! RabhApp.factory('PostModel', function($resource) { return $resource(‚/posts/:post_id' {post_id:’@id’})….
ngmin for Ruby on Rails Add to Gemfile gem 'ngmin-rails'
Integrates seamlessly into the Rails asset pipeline Illustrated by my boilerplate app found on Github https://github.com/stiebitzhofer/rails- angular-bower-heroku
Links You find everything on Github https://github.com/btford/ngmin https://speakerdeck.com/stiebitzhofer/ngmin ! More
questions? Mail to
[email protected]