Search Posts

Category: html5

How to obtain states of form and Input fields in angularjs script without passing them from html?

I have written following code for performing validation of input fields. Here I pass the input field’s states from HTML to script through a function. But I need to just call the function without passing any parameters, and the values should be directly obtained in the script without being passed from the HTML. HTML Part: <form ng-submit=”LoginButton(LoginForm.$valid)” novalidate=”novalidate” name=”LoginForm”> <div class=”row”> <div class=”input-field col s12 center-align”> <input id=”username” type=”text” ng-model=”username” name=”username” required> <label for=”username”>User Name</label> […]

Read data from json

This is my JSON file { “styleMapping”: { “1”: { “zIndex”: 1, “StyleMappingCollection”: { “636404903145791477”: { “border”: { “color”: “#FF000000”, “width”: “Small”, “type”: “Solid” }, “background”: { “bgOption”: “Image”, “thumbOption”: “Pointer”, “opacity”: 1.0, “bgColor”: “#FFF5F5DC”, “bgImage”: “C:UsersrajDownloadsimagesimage.jpg”, } } } i want to capture bgImage parameter in my javascript. My script code is $http.get(‘Data//xyz.json’).then(successCallback, errorCallback); function successCallback(response) { sliderCtrlPtr.sliderParams = response.data; sliderCtrlPtr.sliderParams.height = response.data.deviceHeight; console.log(“After JSON read : “,sliderCtrlPtr.sliderParams); } function errorCallback(error) { //error code […]

AngularJS Select Tab from Button Click

Using the AngularJS tabs directive, is there a way to select a tab from a button. Effectively what I would like to do is click the button ‘Select Tab 3’ and the third tab will be selected. <md-button id=”button” class=”md-raised”>Select Tab Three</md-button> <div ng-cloak> <md-content> <md-tabs md-dynamic-height md-border-bottom> <md-tab label=”one”> <md-content class=”md-padding”> <h1 class=”md-display-2″>Tab One</h1> </md-content> </md-tab> <md-tab label=”two”> <md-content class=”md-padding”> <h1 class=”md-display-2″>Tab Two</h1> </md-tab> <md-tab label=”three” id=”three”> <md-content class=”md-padding”> <h1 class=”md-display-2″>Tab Three</h1> </md-content> </md-tab> […]

ui-grid not showing data angularjs

Can someone please help me. I want to implement data display using ui-grid. But the grid is not displaying data just showing blank yet when i use table with <tr ng-repeat=”transaction in savingaccountdetails.transactions> data is displayed. I want to use ui-grid because of the ability to have fixed header while scrolling for large data but its so hard to make table header fixed, most times columns don’t align. i tried most cases but not working […]

How to show angularjs expression in ternary operator?

actually i want to show angularjs expression in ternary operator,Is it possible to show expression in ternary operator if yes then can some one guide me.Thanks in advance. This is what i have tried but its not work. {{ jdFile ? “Job Description File : {{fileName}}” : “Resume File :{{fileName}}” }} {{ jdFile ? “Job Description File : ‘[fileName]'” : “Resume File :'[fileName]'” }} {{ jdFile ? “Job Description File : ‘fileName'” : “Resume File […]