Angular CSS animation documentation

Share

We’re developing the Gift Uncommon website and apps using Angular.js. Reading Angular’s docs feels like reading a choose-your-own adventure novel (dating myself here…): if you click through the right links you can probably find the outcome you’re looking for, but they don’t necessarily make it easy.

One of my biggest frustrations has been using Angular’s CSS transition support, especially animating ng-if and ng-show and understanding the order in which Angular adds and removes CSS classes for those directives. Angular’s animation docs are spread out over three (trois, 3) pages and after looking through them I still didn’t quite understand how exactly Angular adds/removes CSS classes.

After banging my head against this and resorting to the desperate method of staring at the screen while clicking on my elements hoping to glimpse which classes were being added/removed, I discovered that this information was actually removed for the Angular 1.4 docs but still exists in the archived Angular 1.3 docs.

Access the 1.3 animation docs here

Hopefully that’ll save you some of the time I wasted clicking back and forth through the Angular docs!


Share

Thoughts on the Greek Crisis (2015 edition)

Share

The Greek crisis is a tragic gift that keeps on giving.  The Troika refuses to give up on its tried and failed formula of austerity and raising taxes.  While no one disputes that, under normal circumstances, it makes sense for a debtor to cut back on expenses and increase income in order to pay off that debt, it’s become clear to everyone that we are 5 years into a very extraordinary situation and we need new solutions.

I have two primary reactions to the way things are unfolding.  First, and very simply, it does not make sense for so much of the pain to fall on the debtor.  One of the primary motivations to force debtors to pay back debts is to ensure confidence that debts will be honored.  This serves both to encourage creditors to lend, and also to signal to future borrowers to borrow responsibly and within their means.  There is a flipside to this picture that has not been sufficiently emphasized: how do we encourage creditors lend responsibly?  There has been almost no attention paid to this aspect, both in the Euro crisis and the US financial crisis.  After all, it takes two to make a bad loan.  When that loan is made poorly, why should the borrower bear the brunt of the pain?  In Europe, alas, I fear the answer is that might makes right: since the creditors were French and German banks, the French and German governments made sure that they would be paid back.  I doubt the situation would be as dramatic if it were Greek banks lending to Greek debtors or French banks lending to French debtors.

The second reaction is to ask what if we step back and think about what is going on in “real economy” terms?  Namely, what do all the debts, defaults, and bailouts mean when we strip away the financial language and think about what it means from a real economy point of view.  After all, the point of finance is to allocate resources in the real economy.

First, the debt: because Greece is in debt, this means that the Greece must produce enough, say, olive oil, sunshine and beaches to make up for it.  The production doesn’t have to be directly for the benefit of the creditors (though there has to be a chain of people willing to pay for the production that ends at the creditors).  The key point is that if Greece is doesn’t produce enough stuff, especially stuff that (at least indirectly) are of value to its creditors, it will never be able to pay off its debts.

Next, the austerity: by cutting back on government expenditures, fewer things are being produced for the government.  This, in theory, frees up the resources that were being used to, say, staff unpopular museums and redirect them to produce olive oil, sunshine, and beaches.  But this is simplistic and ignores the two-sided nature of the economic activity: in order for production to occur, someone needs to demand it.  There isn’t enough alternative demand for Greek production to replace the government expenditures, and so the productive capacity is just sitting idle instead of working to pay off the debt.

Finally, the tax hikes: money is the ability to demand production.  In private Greek hands it would most likely be used to incite more production of olive oil, sunshine, and beaches.  But by collecting more taxes and using it to pay off debts, the Greek government is taking this ability and giving it to its creditors.  Now if the creditors were using this to buy olive oil, sunshine, and beaches then this may be productive, but since the creditors are largely foreign and at this point largely inter-governmental agencies, this is not the case.  This spawns a vicious cycle in concert with austerity: austerity decreases production for the benefit of government, and tax hikes decrease production for the benefit of the private sector.  It’s clear that this does not lead to a happy outcome.

Some conclusions to draw from this thought experiment:

  • A purely financial solution to this crisis will always fail.  Something must be done to increase demand for Greek production.  Without that, there is no way out.
    • Interestingly, this is why bailouts are typically accompanied by currency devaluations.  This devaluation causes an increase in demand to counteract the austerity.  Obviously, that’s not an option in the current situation.
    • This is the biggest missed opportunity.  No attention in any of these negotiations, as far as I can tell, is being devoted to how to increase demand for Greek production.
  • One should never ever ever ever think about these things in same terms as we think about individual debts.  With individual debts, the demand for individual production typically remains constant regardless of your expenditures.  (Demand for individual production means your employability, which is reflected in your salary.  Your salary doesn’t drop when you tighten your belt to pay off your debts.)  But this is totally different from the macro-economic case of sovereign debt and austerity.

Addendum: obviously there are other aspects that I’m not discussing like the terrible tax collection situation.  These are serious problems that must also be addressed, but they are less economic and more operational/cultural in nature and so require a different kind of solution.  I also think that, while tax evasion might have helped drag Greece into the current situation, solving it alone will not come close to solving the problem.


Share

The Inflation Puzzle (Part 1)

Share

I wanted to continue the discussion with the question that ended the previous post: if shadow banking was effectively expanding the money supply, then why did it not cause inflation, and more importantly now that the Federal Reserve is replacing the missing shadow money with real money (i.e. Fed deposits), why has this not caused a surge in inflation?

I think it’s important to go over the naïve reasoning why it’s generally thought that an increase in money supply should cause inflation: as prices are determined by supply and demand, when money supply increases the relative value of money decreases in comparison to real goods, which translates into an overall increase in prices.

There are two key assumptions behind this seemingly simple reasoning that go a long way towards explaining why the monetary expansion did not cause notable inflation:

  1. The distribution of money over different parts of the economy does not change even though the overall supply changes.
  2. The velocity of money does not change.

If the first assumption is false, then the naïve reasoning fails because the newly created money does not chase the same goods as before.  Inflation is necessarily measured with respect to a specific weighted basket of goods, dominated by a rather small set of consumer goods (food, housing, fuel, healthcare, etc.).  While having a single number is a useful shorthand, really there is no single number that can capture the global price evolution of the entire economy.  Our reliance on such an inherently limited measure obscures important price phenomena including the effects of monetary stimulus.

I would argue that in some sense, inflation did occur during the lead-up to the Financial Crisis: the housing bubble was a reflection of the same phenomenon that underlies inflation, namely too much money chasing too few goods.  What’s different from our usual notion of inflation is that the price increases overwhelmingly affected a single sector of the economy and so did not drag the entire basket of prices up.  Furthermore, the price increase did not drag up wages because people were largely paying for housing with credit rather than wages, unlike in “normal” inflation where wages would have to go up to match increased prices.  Because wages did not go up quickly, it was unlikely that other goods would increase in price because consumers did not have additional nominal purchasing power to pay more for them.

I’ll add thoughts later on about how this has developed since the crisis.  Hint: it’s pretty much the same story, just look at the stock market and the real estate market (again!).


Share