Tagged Questions
0
votes
1answer
23 views
Best practices for unit testing angular directives
I'm writing some unit tests for directives in AngularJS using Jasmine and Karma as my test runner. As I'm doing this, I'm wondering whether or not I'm following the best means of setting this up and ...
0
votes
2answers
20 views
Why does ngRepeat use a compile function, when all it does is return a linking function?
reading the ngrepeat source, I was wondering why it defines a compile function, while all that does is return a linking function, it's not manipulating the template passed into the compile function, ...
0
votes
1answer
68 views
How to have an angularJS directive on a page called via ajax?
I have the following html (which can be accessed directly or called via ajax):
<section id="content" ng-controller="setTreeDataCtrl" get-subthemes>
<dl ng-repeat="subtheme in ...
1
vote
1answer
18 views
What's the rationale for using -start and -end directives in angularjs?
In order to allow repeating multiple elements, such as dd and dt in a definition list, angularjs will support start and end directives. But what's the rationale for using this, instead of an element ...
0
votes
0answers
14 views
Unit testing a directive that defines a controller in AngularJS
I'm trying to test a directive using Karma and Jasmine that does a couple of things. First being that it uses a templateUrl and second that it defines a controller. This may not be the correct ...
1
vote
0answers
34 views
angular directive 'replace:true' anomaly
I have a strange problem with angular directive.
Here is a detailed description of the facts, embedded within my (2) questions.
I have two directives drtv-a and drtv-b. drtv-a uses within in it's ...
0
votes
1answer
41 views
Partial View does not compile properly in angular
// Code goes here
var mymodule = angular.module('myapp', []);
mymodule.controller('mycontroller', function ($scope) {
});
mymodule.directive('pvTempUrl',
function ($http, $compile, $log, ...
0
votes
1answer
22 views
What is the issue with this code angular custom directive - Resolved
'use strict';
angular.module('$praveen.directives').directive('pvTempUrl',
function ($http, $compile, $log) {
$log.info("Directive Called");
return {
restrict: 'A',
...
1
vote
0answers
45 views
Validation of Angular.JS directive being part of form
I want to make my own Angular directive and use form validation on it. This will allow me to reuse this part of form in other places. The actual code is different, but I feel that I am thinking in ...
0
votes
1answer
26 views
Angular incorrect behaviours with custom directives
Below is my issue
Issue with my custom control code.I have created a two custom control
<pv-Show-Box></pv-Show-Box>
<pv-Hello>Praveen</pv-Hello>
both are working fine but ...
0
votes
1answer
46 views
Directive to dynamically create an ng-pattern
I'm trying to create a directive for an input element that will dynamically create an ng-pattern to check for a valid IP address in the input field. All of my attempts to do so have been completely ...
0
votes
1answer
44 views
communicate between angular controller and route controller
index.html
<body>
<div data-form-modal >
<form>
<input type='text' name='test'/>
<input type='submit' value='submit' ...
1
vote
1answer
86 views
Adding directive makes controller undefined in angular js code
Here is my angular js app with html code
<html>
<head>
<title></title>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
...
0
votes
0answers
32 views
Update element scope with controller via directive
so... i lost a lot of time on thinking how to fix this issue: http://jsfiddle.net/9AshA/5/
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
}
myApp.directive('usModal', function () ...
0
votes
1answer
32 views
angular directive attributes are set (or not) yet present inside a setTimeout with 0 seconds
I have this fiddle
angular.module('mainApp', [])
.directive('list', function factory() {
return {
restrict: 'E',
scope: {
size: '=',
...