My Angular app teaches kids how to cook. The main screen of the app is a kitchen.
On the left, the user can select a food category of the ingredient they want to add. Then, in the next column, they can select the specific food.
So for example, if they want to see all the spices, they click "Spices" and then drag the exact spice into the pot.
My question is, how can I get the "Spices" button to be highlighted while it is in use?
I've seen some similar questions but they are all related to routing. This is not related to routing (i.e. the page is not changing)
Use ng-class to toggle some sort of 'selected' class based on what is unique about your data when you click on that particular menu item. It could look something like this:
<a ng-click="items = spices" ng-class="{selected: (items === spices)}">Spices</a>
Then you just need to create a style for your .selected items.
Related
I start out in a listview where each item in the listview is an item each with a unique _id displaying only partial information, clicking on them will route to another page and display all the info. Now, I click on an item, route to the unique id and a brand new component, then, in the new component, I take that unique ID, search up that unique ID in my MongoDB database, then display the item that was found.
If not, what is a better way? I was trying to model youtube's URL design (at least what it appears to me), in the home page, they display many videos, and then on click, they route to /watch + specific id, and then display the video.
I want to assign a template style to a category articles in joomla3. FLEXIcontent items Indeed.
I have a cooking category and I want it's items to have different Template Style.
* I have many items in this category and I can't make menu for all of them.
If you group articles into a category and you made a menu item for that (like blog category layout - and select the grupped articles category) then you can assign different template.
You dont have to show this menu item on frontpage. And every article what you grupped into that category will use the template selected in the menu item.
How can I edit the layout of category.
I am unable to find the solution. I need to edit it via Control Panel, not using direct file editing.
To edit the layout of category, Edit the menu item that is linked to that category. In the menu item edit page, you will find all the option for changing category layout.
Also you can change the Global options in Content > Categories page then click on the options button to see all category options.
I have an app with a Sidebar, which is its own module with its own region, and a primaryRegion that can show views from two other modules (a Dashboard view or a Detail view of an item selected from the sidebar).
When an item gets clicked in the Sidebar, it changes its display to show that it's been selected and gets displayed in the primaryRegion.
The problem I'm running into is that I've recently added routes to the app to directly display item details in the primaryRegion and I can't maintain this behavior when going directly to the Detail view for a given item.
Given that only one module can respond to a route, how can I get the Sidebar to select the item designated in the URL and also display that item's Detail view in the primaryRegion without using a global object or introducing race conditions?
Apologies for the lack of code, I'm having a hard time reducing it down to the essential parts while keeping it clear. Hopefully my description is good enough but if not please let me know and I'll provide more detail.
I can think of two options you could try:
Have Detail fire a global event when it renders, and have the Sidebar be listening for that event and highlight the correct item based on the data it gets from that event.
Or have your Sidebar handle the routing and use a variable route to determine what Detail to render. For example, have a route in the Sidebar of 'details/:id': showDetails' and then a function like:
-
showDetails: function(id) {
// highlight item with id === id here
this.primaryRegion.show(new Details(id));
}
I define a menu in drupal7 that look something like:
school
--people
----teachers
----pupils
I create:
Content type for people.
Menu with the above titles.
When I add person to people’s content, I choose if he belong to
'teachers' or 'pupils' in the menu.
Now I need that pressing on the menu will give me a list of all that kind of people.
For example, pressing on ‘school->people->teachers’ will give me the list of all
the teachers, one line for each teacher.
So I thing to build a view that get the menu/sub menu as parameter and give me the
appropriate output.
But I don’t know how:
Send to a view the menu / sub menu as parameters. (How to send parameters to a view)
How to filter the view by this parameter and create the specific page.
Create 2 views pages (teacher and pupils)
Where you will show list of all the teachers or pupils
In menu ----teachers add path on views page teachers.
In menu ----pupils add path on views page pupils.
After click on menu you will redirect to the desired page
Update Watch Duplicate Copy Move