Gus's public fiddles
-
Communicate two controllers in angular avoiding share the scope but using a service.
On some specific context you might want to communicate two controllers. Sharing the scope is not recommended. So this approach uses a service as a communication channel between both of them. It will keep the controllers completely decoupled and delegates the message transport to an injected service. EventEmitter.js is used to handle the event. In this example, the controller of a main content view will talk to the navbar controller to inform some change.
-
Stretch an image by using CSS.
Stretching an image to fit the container and maintain aspect ratio by using CSS.