Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I create a new, uh, thing in Angularjs?
    text
    copied!<p>I think the vagueness of the question is part of the problem, so my real first question is, what do you call, in Angular, the <em>thing</em>.</p> <p>The thing I'm trying to name is the view plus the controller, over the model of a single object. I don't even know what to call it. For things I know ahead of time I'm going to need, I've been creating <em>directives</em>, but what do you call one instance of the thing that a directive creates?</p> <p>I have several situations where all of a sudden (in response to some external event), I have a new object in the model and I want to show it on the screen. Angular seems to want me to list all the possible views <em>ab initio</em> in their parent view, but that isn't really reasonable in my case. How, for example, would I list all the pop-ups and tool-tips and other stuff.</p> <p>I'm down in some little edge case, deep in the controller code, and it needs to add something to the current view. What's the accepted practice.</p> <p>Incidentally, the $route/ng-view is one case of exactly this. The view containing the ng-view, and the ng-view DIV itself, have no idea what the $route module is going to put in the ng-view. I need the more general case of this strategy.</p> <p><strong>EDIT</strong></p> <p>People keep asking for an example. How about this: I'm making an equipment-requisition app. When a user asks that one of the 1000 different type of equipment be sent to him, I need to display a pop-up that gathers addition information specific to that type. If he asks for a screwdriver, the pop-up will ask about blade size, neck length, and handle composition; if he asks for an airplane, it will be a wizard ask him about engine size, fuel tanks, seating arrangement. All the app knows on start-up is the list of all equipment types, and the name of the UI element that gathers all subsequent information about each particular type.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload