I am creating a single page application using backbone.js.
My scenario is to render three different layouts in the same page on clicking three different clicks.,,should I create three render functions for these click events in the view?
You could create three different render methods, but it would probably make more sense to make a different view for each page. You can then hook each of those views up to separate routes to get three (pseudo-) pages.
Related
I have a nextjs app with two pages, they have same design but both display different data, what is the best way to implement this idea with keeping the url path unique for each page.
after asking some friends about this issue the best answer i got (from my prospective) is to separate the repeated code at the two pages into a new directory which I named shared and a new component that has only one job to display the data passed to it from both pages.
Right now I am using ng-datatable for displaying data in a table, but I want to write a custom directive to display data in a table grid.
I'd recommend going to another site for the tutorial on creating a directive/component. Nothing really beats the AngularJS site itself, but there is a ton out there. For directives AngularJS Directives, for components AngularJS Components. Considering web components are more robust than directives I would recommend going the path of the components.
For example:
You can split your grid into many different factions for modular/reusable components throughout your project. Create a component for your header, a single row (pass each record from your collection into the row component), a pagination component, filter/search component, etc.
Good luck on your endeavors.
I'm new to AngularJS, and i'm want to know what's the best and easiest practices to do this simple shop list application.
So this is my shop:
I got three servers in my select input. Each server got own list of items, displayed in another component.
I'm thinking about creating routes with variables like localhost:4200/shop/{server1} which gonna show my list of items based on url path. Select option will just change path in my application to show shop list for specific server.
Is it a good practice, or there is better and easier solution to implement this simple shop application?
If you're asking if filtering data with routing is a good practice with Angular, I can say that it is not a bad one. Here's a link to the official Angular documentation about routing : Angular - Routing
But if you're asking if it is the only way to filter data or spread parameters, the answer is clearly no. Angular projects are SPA (Single Page Application), so you can do everything without touching the url.
For a quick example, you can attach a (click) event on your elements that display the shop list you want
I think you can use just one component and three different click events to display three different results. One component can work in your case. Using a router and routing logic for your requirement will be a costly affair. Your user will have a better application feel if these are covered in just one component and with three different click events.
I am trying to create one html page using AngularJs with multiple views. And each view have nested states. When I am trying to use two view with nested states. It's only displaying one. Please tell me if I can use any particular steps or any link. It will be really helpful.
I have folder structure like shown in the attached imageFolder structure.
--Trying to add three child views into Parent-folder.html
A little view of what I am trying to do.
The following link will be helpful to explore nested state in angular ui router
multiple states by name
What is the best way to create multiple views with different models using the backbone boilerplate? It seems like things are set up to render individual pages, but not to render multiple resources simultaneously.
I think I am understanding you correctly, but please let me know if I am not. Backbone shines in SPA's (Single Page Apps). I am not saying that it should only be used for an SPA. If you start thinking of views as sections on a single page, I think Backbone starts to make more sense. So when your model updates or changes, the section/view is being re-rendered and not the entire page.
Look at the Trello and read this article http://blog.fogcreek.com/the-trello-tech-stack/ - especially the part on Backbone. I think the above will answer your question more thoroughly.
Tyrone