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
92
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
170
Rails AngularJS Bower Heroku
stiebitzhofer
4
590
Other Decks in Programming
See All in Programming
CSC509 Lecture 07
javiergs
PRO
0
240
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
1.1k
3年ぶりにコードを書いた元CTOが Claude Codeと30分でMVPを作った話
maikokojima
0
620
AI Agent 時代的開發者生存指南
eddie
4
2.1k
Webサーバーサイド言語としてのRustについて
kouyuume
1
4.3k
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
320
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
350
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
190
CSC305 Lecture 06
javiergs
PRO
0
270
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
3
13k
Google Opalで使える37のライブラリ
mickey_kubo
3
130
One Enishi After Another
snoozer05
PRO
0
150
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.3k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.8k
Into the Great Unknown - MozCon
thekraken
40
2.1k
Designing Experiences People Love
moore
142
24k
Context Engineering - Making Every Token Count
addyosmani
8
300
It's Worth the Effort
3n
187
28k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Speed Design
sergeychernyshev
32
1.2k
Making the Leap to Tech Lead
cromwellryan
135
9.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]