Skip to content

Tag: javascript

Vue: applying css class if specific condition is met

I’m making a custom image slider using vuex, I want to apply a specific class to the dots used for navigating the sliders, so if the dot is active it will be applied a dotActive class. I want to use activeSlider variable for this This is the slider component: And my Slider Store: I know this could be made eas…

How can I create a custom loading indicator in Nuxt.js?

Inside this page (https://nuxtjs.org/api/configuration-loading-indicator#custom-indicators) says that I can create a custom loading indicator but not says how. Somebody can help me – how to create and set this into to nuxt.config? Answer Here is a collection of default loading indicators in Nuxt.js sour…

Calculate Number from a loop increment number

The code I am trying I have a loop increment variable loop and it counting 1,2,3,4,5…. I need to calculate 2 number from incremental variable: one is rounding 0,1,2 (loop % 3) I can do this but other 0,0,0 or 1,1,1 I mean I need to hold a number according to my round number. Answer Fixed your code ((loo…

Shared module imported in AppModule

I was reading the Angular documentation about modules, looking for a line that discourages importing a SharedModule inside the AppModule. I didn’t find anything about that, just a GitHub issue which states that it’s better not to import it. However without any deep explain… https://github.co…

How to add validation. in input field in AngularJS?

could you please tell me how to add validation. in input field in angular js ? Actually I am making a form which is generated by json .I already add validation of required .if user submitted blank value it show “red border” .But I need more validation like User will not enter “digits” …