Tagged Questions
24
votes
3answers
2k views
When writing a directive, how do I decide if a need no new scope, a new child scope, or a new isolate scope?
I'm looking for some guidelines that one can use to help determine which type of scope to use when writing a new directive. Ideally, I'd like something similar to a flowchart that walks me though a ...
0
votes
2answers
592 views
What is the difference between '@' and '=' in directive scope
I've read the AngularJS documentation on the topic carefully, and then fiddled around with a directive. Here's the fiddle.
And here are some relevant snippets:
from the html:
<pane ...
0
votes
5answers
832 views
AngularJS controller inheritance
AngularJS has a DOM based controller inheritance, as mentioned in the angular Docs.
<div ng-controller="BaseController">
<p>Base Controller Value: {{value}}</p>
<button ...
0
votes
1answer
263 views
Angular.js filters and functions on scope that is changing every second
The problem. I have a table of entries($scope.entries), each row(ng-repeat) with 5 columns, 2 of those columns have custom made filter for various transformations.
Now in the same scope I have ...
4
votes
2answers
1k views
Sending event when angular.js finished loading
wondered what's the best way to detect the finish of page loading/bootstrapping, when all directives done compiling/linking
any event already there? should i overload the bootstrap function?
thanks ...
0
votes
1answer
151 views
Bind ngInclude to different models
Is it possible to specify model for ngInclude so that any changes done inside the included template are reflected on the specified model. For instance:
I have a model such as :
$scope.member = {
...
0
votes
2answers
2k views
ng-repeat list in Angular is not updated when a model element is spliced from the model array
First of all, live example con be found here
Hi everybody, I have two controllers and share data between them with an app.factory function.
The first controller adds a widget in the model array ...
0
votes
0answers
474 views
AngularJS - directive scope not setting ng-class on element
Plunker
I have a table of data:
<table class="table table-hover" ng-class="dndElemClass" drag-and-drop>
...
</table>
My goal is to give the table a drop shadow by assigning ...
4
votes
2answers
587 views
$watch not being triggered on array change
I'm trying to figure out why my $watch isn't being triggered. This is a snippet from the relevant controller:
$scope.$watch('tasks', function (newValue, oldValue) {
//do some stuff
//only ...
2
votes
1answer
126 views
Why formatters does not work with isolated scope?
Why formatters does not work with isolated scope? Is this angular bug or I am doing something wrong?
This contains isolates scope and does not work: http://jsfiddle.net/YbdXQ/56/
restrict: 'A',
...
1
vote
1answer
35 views
AngularJS: Alerts don't show up when multiple messages change ngModel for message
I have a notification service which works well for when page is loaded and Controller is loaded
But when I have different buttons calling different functions, they change message, but alerts don't ...
1
vote
1answer
103 views
Unable to inject `$http` using AngularJS explicit `app.controller` syntax?
I have been told that I should be using the app.controller syntax, in order to support minification.
Rewriting the sample (tutorial) example, and I found that I couldn't get it to work:
use ...
1
vote
2answers
91 views
AngularJS Scopes and Deferreds
I have a service that does something hard and returns a promise:
.factory('myService', function($q) {
return {
doSomethingHard: function() {
var deferred = $q.defer();
...
1
vote
1answer
111 views
AngularJS - AlertFactory open dialog behavior
i'm creating an AlertFactory because ui.bootstrap.dialog doesn't works in my app.
So i type follow code: http://jsfiddle.net/Premier/BHqKB/17/
enter code here
It works very well if you click on ...
1
vote
1answer
392 views
Isolate scope attributes defined with @ are undefined/disappear in directive's link function
The directive has isolate scope, and the scope attributes are being passed with "@".
This is how the directive is called:
<div ng-init="classForIcon = 'vladClass'"></div>
<div ...