Goal: make Angular’s url/controller corresponding system work in Rails.
Tag Archives: AngularJS
Angular Material Style Not Working
It’s likely that you forgot to set up the theme in JavaScript. No it won’t work at all without theme setup.
Reference: $state.go() with Parameter
To go to this state with a bookName
parameter:
state('book.name', { url: '/books/:bookName', ... })
Angular: Dependency Injection with Providers
Error message:
Uncaught Error: [$injector:modulerr] Failed to instantiate module x due to: Error: [$injector:modulerr] Failed to instantiate module x due to: Error: [$injector:unpr] Unknown provider: xx
Angular Directive: angular-checkbox-set
Links: Github Repo / Live Demo
Angular directive, with recursive support for multiple layers of checkboxes.
Angular Best Practice: Directory Structure
The most important thing is of course to find something that works for you. The other thing is that, as its creator Miško puts it, once you structure it in a particular way, and other people structure it the same way, it makes it easier for you to leap from one project to another.
Angular Best Practice: Naming Conventions
Summary: UpperCamelCase for Controllers and constructor Services, lowerCamelCase everywhere else.
A little tweak with Chrome Console
This strange behaviour with console is worth paying attention to: it updates the object when you expand it. Say we have:
Using Karma With RequireJS
Since I was trying to dig deep into AngularJS, I thought I’d give tests a go. Then I ran into Jasmine. And Intern. And Karma. And it wails about no timestamps.
Understanding AngularJS
These are the questions I encountered while trying to wrap my head around it:
Q: What does it do?
A: With AngularJS, HTML is no longer just static elements waiting to be manipulated to go alive, they are the structure and the logic. “They extend HTML by teaching HTML new tricks.” E.g., with a drop down menu, traditionally we’d go: