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
93
0
Share
ngmin
Short presentation for first AngularJS Vienna meet up on April 17th, 2014.
Hannes Stiebitzhofer
January 17, 2014
More Decks by Hannes Stiebitzhofer
See All by Hannes Stiebitzhofer
FormulaJS
stiebitzhofer
0
170
Rails AngularJS Bower Heroku
stiebitzhofer
4
600
Other Decks in Programming
See All in Programming
Running Swift without an OS
kishikawakatsumi
0
690
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
450
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
230
RSAが破られる前に知っておきたい 耐量子計算機暗号(PQC)入門 / Intro to PQC: Preparing for the Post-RSA Era
mackey0225
3
130
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
190
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
180
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
5
2.5k
アーキテクチャモダナイゼーションとは何か
nwiizo
17
4.6k
Feature Toggle は捨てやすく使おう
gennei
0
490
Don't Prompt Harder, Structure Better
kitasuke
0
630
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
160
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
420
Featured
See All Featured
Odyssey Design
rkendrick25
PRO
2
570
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
Leo the Paperboy
mayatellez
7
1.6k
Accessibility Awareness
sabderemane
0
94
Designing Powerful Visuals for Engaging Learning
tmiket
1
330
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
410
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
Darren the Foodie - Storyboard
khoart
PRO
3
3.2k
How to make the Groovebox
asonas
2
2.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
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]