I Am Using NgbCalendar and on Runtime need to change it from NgbCalendarGregorian to NgbCalendarIslamicUmalqura - angular6

As far as i know in Angular 6 for NGBCalander we need to change the Class in Providers Section of the Module.ts to change the calendar type between NgbCalendarGregorian to NgbCalendarIslamicUmalqura. But how to achieve this on Run time based on Language selections of the user is something i am having trouble to achieve. Any help will be appreciated

You can switch between two components: one display a gregorian calendar, and one display an islamic using ngIf or ngSwitch

Related

Angular how to make reusable buttons

Good afternoon everybody.
Let me better explain the situation.
In a myComp.html I got the instance of some dropdown-buttons from another component <app-myButtonsFromAnotherComponent></app-myButtonsFromAnotherComponent>.
The dropdown-buttons are being displayed correctly BUT when I try to get the script which they are originally connected myButtonsFromAnotherComponent.ts they do not seem to communicate at all with it (I am using a Getter function in the .ts but it doesn't retrieve the datas) and at the same time, because of the instance, I cannot access their values from myComp.html either, I can just display the buttons on the screen and display the values through {{theValueInQuestion}} int their original HTML file.
Can anyone, please, help me to get those values and use them in my script?
PS Why "reusable" in the title? Because in such a way I can keep those buttons in a separate component and let other components grab them without copy and paste a ton of code.
They are two separate components you need a way to communicate between components.
you can look more into :
Localstorage
Output() and EventEmitter
Parent to Child via Input

Angular 2 Material Combobox

I am using Angular 2 material UI for my application, and I trying to make a form in which 2 fields has a combobox but while research about that I came to conclusion that the combobox doesn't exist for material UI. So my question, is there any work around for this issue, as it is important for me to use the combobox in my application?
I was able to use the Autocomplete control to achieve this. It has a defined list of items to pick from and you can also enter text... https://material.angular.io/components/autocomplete/overview
You could use the select component of Material, which is basically the same deal as a combo box.
https://material.angular.io/components/component/select

Multiple search elements

I am stuck when it comes to adding more than one search element. I can get 1 search element to work using the Fusion tables layer wizard but any others added don't function? My website is called earthquakedamagemap.com. I'm trying to build a similar search function to that of newspapermap.com
It is my university project. Any advice would be much appreciated!
Try changing the id of your second select menu to search-string1. Then, in your changeMap1 function, pass 'search-string1' to the method document.getElementById().

Best solution for a drop down list with over 300 rows?

I have this problem, in a form I have a list of customers that could be more than 300 and, for me, it isn't very simple find over there because I should scroll all results for find a single row!
On the old technology I had a button that opened a pop up where I should research which customer I should select and than I used a javascript for recording the selection on the first form, but It could be a good solution with new technology!
How can I resolve this doubt? What is the best solution for big <select> tag?
You basically want an autocomplete dropdown list. This does not exist in the standard JSF component set and it is also not exactly trivial to implement with JavaScript/jQuery on top of the standard JSF component set because the available values have to be present in the server side's state. You also basically want a dropdown list which is represented by a <div><input><ul><li> instead of a <select><option> because a normal <select> doesn't allow the enduser to type text in. The standard JSF component set does not have a component which renders the desired HTML markup. You'd basically need to create a custom JSF component.
There are 3rd party JSF component libraries which already offer a fullworthy JSF autocomplete dropdown list. It would be easier to use either of them instead of reinventing the wheel by a custom JSF component. Take your pick:
PrimeFaces - the <p:autoComplete> component
RichFaces - the <rich:autocomplete> component
OpenFaces - the <o:suggestionField> component
ICEfaces - the <ice:selectInputText> component
you can try jquery ajax autocomplete
Refer to:
http://docs.jquery.com/Plugins/Autocomplete
http://jqueryui.com/demos/autocomplete/
Yes, the jQuery autocomplete plugin is the best solution for you while you have a large number of items.
By the way, imagine that you would like to select an item with specific letters. While you are using drop down lists, you can point to your wanted items by typing their names from the first letter of each one. But using jQuery autocomplete, you can search a string or a group of letters in everywhere. it does not matter if are your inserted letters located at the first of your item names or in other places.
As ShantanuD said, you can find this plugin in http://jqueryui.com/demos/autocomplete/

Switching Chart types on the fly

I'm working on a reporting app which displays incoming data as pie by default. We'd like to offer the user the ability to switch to bar, or column, or area, or any of the other charts with the click of a button. Since we already have the data in the app, it should be fairly simple no? Does anyone have an idea of how I might approach this?
andy
You can approach this a couple different ways. If it was me I would either set up a view stack with each of the chart types you want the user to switch to and they you can simply change the viewstack selectedIndex. Alternatively, you can have just a single chart holder container. Then just make function to dynamically generate each chart (Example). Then all you need to do is remove the existing and add the new chart.
I accomplish this by creating a state for each specific chart type. Then just change between states based on user input. You can use one data provider for each chart or create specific data providers for each.