The ngModel directive binds an input,select, textarea (or custom form control) to a property on the scope using NgModelController, which is created and exposed by this directive.
1
vote
1answer
24 views
AngularJS mantain state when changing views?
Is there a way to maintain $scope when changing views and coming back?
When i load a certain view there is some heavy loading (loading data), but if i switch views and comeback to this one al the ...
0
votes
0answers
33 views
Angular nested directives scope not shared
I have my input directive which takes the input value from html, and updates the angular model:
.directive('input', function($parse) {
return {
restrict: 'E',
require: '?ngModel',
link: ...
0
votes
1answer
30 views
AngularJS - Using Model in Controller causing Model to update
I have an Angular application where in I'm pulling from a model some data which is saved on the load of the app. For simplicity sake, I've explicitly defined the data which is being pulled.
The issue ...
0
votes
1answer
30 views
How do I make sure that each instance of my angular model has certain characteristics?
I have some tasks to do . I want to make sure that each task has a maximumFundPossible property of $1000 constant, a currentfund property that is variable as it will be updated as tasks are being ...
0
votes
1answer
36 views
angularjs values not being saved in the scope from textbox
I have this html markup:
<div data-ng-controller="VehicleProfileController">
<modal title="Add Vehicle Info" visible="showVehicleInfo">
<div class="container">
<div ...
1
vote
0answers
39 views
Angularjs MV* (MVW) Design Pattern Involving ES6 - AngularJS
I have read these answers by Izhaki and Artem Platonov on Understanding Design Patterns and have some questions about this approach. They might be trivial, but I need some answers.
The final answer ...
0
votes
1answer
49 views
Unable to track and bind to input elements created with ng-repeat
Here's my template, I am dynamically creating input elements to be used in a form. When I submit the form nothing is passed to the update() function designated on the submit element as nothing appears ...
0
votes
2answers
42 views
Angular JS get value of date input with ng-model
I try to get the value of my input date html 5 component by binding it with ng-model like this:
<input type="date" id="dateFin" class="form-control" name="dateFin" ng-model="filtres.dateFin"
...
0
votes
1answer
48 views
Not able to display number of rows in a table based on drop down or input field
I have a table with 'n' number of rows and by default i have set to display 10 rows in each page as the table is a paginated column.
I am now trying to include a text box where user can enter number ...
1
vote
1answer
141 views
AngularJS ngModelOptions updateOn 'submit' validateOn 'default'
Is there any way how to trigger validation when using ngModelOptions? My use-case is to have a form with all fields updating the ngModel on submit (due to the fact that I would like to revert the ...
0
votes
1answer
78 views
Prevent backspace from navigating back in AngularJS Model Window
I am using angular model service ($modal) display pop-up. I am facing a problem like when user click backspace on the model window, parent window gets navigating to previous page. How do i resolve ...
1
vote
1answer
2k views
How to add/remove item to/from list in ionic
I have create tabbed ionic application in VS2015. Now I want to add there simple list with possibility add/remove items (something similar to this - sample of angularjs app)
My HTML code ...
0
votes
1answer
262 views
calling a function from controller inside other controller
I am display a modal where if the user click on delete button I want to call delete() from controller A inside controller B
I am refactoring the Todo App example code at AngularJS website (based on ...
0
votes
1answer
256 views
AngularJS Initialize model directly from view using strongly typed object in asp.net MVC
Is it not possible to use strongly typed objects in asp.net mvc to initialize ng-model properties as currently the view value is getting cleared as soon as ng-model property is getting bind to view.I ...
0
votes
3answers
31 views
Update $scope collection upon closing modal
I'm having the most difficult time trying to find a way to make sure the parent scope's collection is updated with the saved information from a modal.
The parent has a collection of event speakers, ...
0
votes
1answer
54 views
Highlight all inputs that where programatically changed in AngularJS
I have a form with fields that are editable by the user. Some of them, until they are $dirty (edited by the user) will update automatically with suggested values.
I want to mark this change (flash ...
1
vote
2answers
73 views
How to make Angular bind blank inputs to a model?
Here is a simple Angular example:
<!DOCTYPE html>
<html ng-app="GenericFormApp">
<head>
<script ...
0
votes
1answer
24 views
Angularjs update model partially in input value
i've a strange behaviour with a model.
$scope.ev = temp;
<input type="text" class="form-control" id="inputDataFineEv" ng-model="ev.dataOraFineEvento" placeholder="Data fine" ...
0
votes
1answer
235 views
Angular directive multiple inputs one model
HTML:
<html ng-app="app">
<div class="container" style="margin-top: 30px">
<input type="text" ng-model="newName" key-filter/>
<input type="text" ng-model="newName" ...
0
votes
3answers
17 views
Filter a model when there is pagination
My situation right now is that I have a model that loads like 50 car informations.
In the view I have a sidebar with some filters like, year, model, mileage, etc..
When I filter those, everything ...
14
votes
4answers
14k views
AngularJS - how to change the value of ngModel in custom directive?
Lets take a look to my directive:
angular.module('main').directive('datepicker', [
function() {
return {
require: '?ngModel',
link: function(scope, element, attributes, ngModel) {
...
3
votes
2answers
380 views
Parser function does not get called for change in input textbox
I am new to parsers and formatters. I have a directive that will be doing validation on change of the model.One way to do this is the $watch but from what I understand that is not a good way since it ...
1
vote
2answers
55 views
Angularjs model not updated when switching between users at login
I need the following functionality: When a user goes to the login form, the browser should auto fill the username and password.
My implementation works (on FF and Chrome) but, there is this bug (not ...
9
votes
2answers
45k views
Why is Angularjs ng-pattern not working with the following regexp?
For some reason the initialized value doesn't appear in the field, but the second field without the ng-pattern does work. any ideas?
angular.module('app', []).controller('MainCtrl', ...
0
votes
1answer
417 views
Watch a custom directives inner html in angular
I have a global search variable that is used by the whole app
newspaper.controller("MainController", function($scope) {
$scope.search = {query:''};
});
Then I have a contenteditable div that I ...
0
votes
1answer
45 views
Use filter with angularjs controller
I use this code to add a property in the filter when a checkbox is cheked.
<input ng-model="filter['model']['first']" value="first" type="checkbox" name="model">
I tried to do this in the ...
0
votes
0answers
82 views
AngularJS: How do I access $scope objects after being dynamically created
I have created dynamic filters based on the dynamic columns in the table:
using the code below to dynamically generate the binding model:
<div data-ng-repeat="label in bluePrintItems[0].labels" ...
0
votes
1answer
20 views
Why did the model Array here not update in the DOM after updating in the Controller?
http://plnkr.co/edit/7OnKAGvVNXWLwN5fZqJu?p=preview
I'm setting up a question related to infinite scroll and noticed that when I update the $scope.tags array I have once the tags have been scrolled ...
1
vote
2answers
408 views
Changing value of an input date picker with button angular
I have have an input field which is attached an Angular UI datepicker.
Below that, I added 2 buttons to change date, "day by day".
Here is the input part (just after in my page):
<p ...
0
votes
1answer
128 views
Creating model from multiple models in AngularJS
I have this basic fiddle which is a cut down version of what I have on my site.
I was wondering if there is a way to bind the table rows dynamically to a text area to create a ng-model composed of ...
0
votes
2answers
1k views
Referencing the element that is calling a controller function Angularjs ( ng-change / ng-blur / ng-* ? )
The original question asked about how to determine which element called the controllers blurr function, but I didn't clarify that I was not specifically asking about ng-blur, but ng-* (ng-change, ...
12
votes
1answer
2k views
Consider a form invalid while async validator promises are pending
I have an async validator:
app.directive('validateBar', ['$http', function($http) {
function link($scope, $element, $attrs, ngModel) {
ngModel.$asyncValidators.myValidator = ...
0
votes
1answer
132 views
ng-model does not work in select directive
What is working: The ng-options contains all names and it is shown in the dropdown-list.
Problem:
At the beginning if nothing is selected, there should the text "Select name..." displayed. But ...
0
votes
0answers
126 views
Tinymce editor becomes empty when ng-repeat list is reordered
This is a simplified example of a bug we faced in our project recently.
I have a list of objects with "name" and "position" properties and wanna use TinyMCE editor instead of textarea to display ...
7
votes
2answers
184 views
AngularJS orderby doesn't work when orderby-property is edited
I have a list of objects in my scope and want to iterate over them, show some of their properties in ordered-by-some-property way and change them.
ng-repeat is used to display textboxes binded to ...
2
votes
0answers
80 views
CKEditor prevents framework's and native events propagation
I am having an angular directive that is compiled and inserted into CKEditor. Furthermore i have a widget plugin that upcasts those directives to widgets and allows few of their fields for editing. In ...
0
votes
1answer
147 views
AngularJS: Why ng-model scope's variable is not shown in inspector if input field is empty?
I have an input form like this:
<form name="userForm">
<md-input-container>
<label>Username</label>
<input name="username" ng-model="userLogin.username" ...
0
votes
2answers
320 views
Correct approach for angularjs modal transferring data to outer controller?
Im wondering what is the correct approach about software design & best practice for angularjs modals.
In my application I have the main window which is using its own controller, and there I have a ...
0
votes
2answers
689 views
How to pass a directive template model to controller / parent scope
Ugh I'm stuck in one of those Angular binds (no pun intended) where I can't get my controller to talk to my directive.
My directive is the following, a select dropdown with a template:
...
0
votes
1answer
377 views
accessing values from an object model using 'controller as' $scope angularJS
I'm attempting to grab the user.firstName and user.lastName, add a watch collection to those models, and spit back out a userName.
I can't seem to communicate between the two, I think I'm using ...
0
votes
2answers
160 views
Prevent model update before save
I go the list view page click on edit of any element. Change something on textbox and click cancel. This navigates to list view but the entry is now updated even without me saving.
Route
(function ...
1
vote
2answers
85 views
Preserve empty field in model with Angular
If I have an angular form like this
<form name="myForm">
<input type="text" required ng-model="field1" />
<input type="text" ng-model="field2" />
</form>
...
1
vote
4answers
1k views
Pass function from model into directive in AngularJs
I created one directive in Angularjs now binding model data into directive , problem is that I have I am using JqGrid and I want call one function when JqGrid's gridcomplete event will call.
...
2
votes
4answers
265 views
AngularJs - model value does not reflect on ui in nested controllers case
I am using angularjs for one of the my module in application. I want to update UI of various locations on page, so that all ui components will work synchronously as the model value changes.
here is ...
0
votes
1answer
165 views
AngularJS: does the directory structure (e.g. modular programming) influence loading time?
Can modular programming contribute to lower loading time and how?
I read about ways to Modularize AngularJS applications. In general the reason for doing so is to have a good structure when creating ...
4
votes
3answers
471 views
Angularjs updates the view but not the model
please pay attention this is the opposite of 99% of the related questions on stackoverflow.
Mi problem is: I have a dependent select, when the 'Master' select changes, the 'Slave' view gets updated ...
0
votes
2answers
144 views
Binding repeatable form subset to model
On a registration form I allow a user to enter zero or more phone numbers. Each phone number consists of a prefix and a number, these are two fields per phone number. The user may decide how many ...
0
votes
1answer
75 views
Can we update JSON files on the fly in Angularjs?
Angular JS seems to have a problem updating content in .json files on the fly. Specifically I have to restart the server (locally) in order for angular to recognise the new data. This seems to be how ...
0
votes
1answer
174 views
Angularjs-more module dependency issue
I am using more dependency modules for various application.I want to show the ngtable using directive. but this was not working.
sometimes no error, some time i am getting following the error
...
1
vote
2answers
337 views
opening a modal without using a button in angularJS which is accessible to all the controllers
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Standard message modal</h3>
</div>
<div class="modal-body">
...