[AngularJS] Re: Using ngRoute correctly

2014-10-06 Thread Sander Elias


Hi izanywhere,

AngularJS routes work linear, (As do most routing systems!)
This means, that as soon a path evaluates as valid, that’s the route being 
used. 

in your case, probably nothing goes behind .when('/:page', ...)

Regards
Sander
​

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Using ngRoute correctly

2014-10-06 Thread izanywhere hk
Thank you for your reply. I did of course try that first time.. :) Please 
see code below. Not clear what am I missing..

var smartApp = angular.module('smartApp', [
  'ngRoute',
  //'ngAnimate', // this is buggy, jarviswidget will not work with 
ngAnimate :(
  'ui.bootstrap',
  'plunker',
  'app.controllers',
  'app.demoControllers',
  'app.main',
  'app.navigation',
  'app.localize',
  'app.activity',
  'app.smartui',
'app.f1Controllers',
'app.f1Services'
]);

smartApp.config(['$routeProvider', '$provide', function($routeProvider, 
$provide) {
$routeProvider
.when('/', {
redirectTo: '/dashboard'
})

/* We are loading our views dynamically by passing arguments to the 
location url */

// A bug in smartwidget with angular (routes not reloading). 
// We need to reload these pages everytime so widget would work
// The trick is to add / at the end of the view.
// http://stackoverflow.com/a/17588833

.when('angular/ui', {
templateUrl: 'views/angular/ui.html',
controller: 'PageViewController'
})

.when('f1/f1Drivers', {
templateUrl: 'views/f1/f1Drivers.html',
controller: 'f1DriversController'
})

.when('f1/f1Drivers/:id', {
templateUrl: 'views/f1/f1Driver.html',
controller: 'f1DriverController'
})
/*
.when('/:page', { // we can enable ngAnimate and implement the fix 
here, but it's a bit laggy
templateUrl: function($routeParams) {
return 'views/'+ $routeParams.page +'.html';
},
controller: 'PageViewController'
})
.when('/:page/:child*', {
templateUrl: function($routeParams) {
return 'views/'+ $routeParams.page + '/' + 
$routeParams.child + '.html';
},
controller: 'PageViewController'
})
*/
.otherwise({
redirectTo: '/dashboard'
});

// with this, you can use $log('Message') same as $log.info('Message');
$provide.decorator('$log', ['$delegate',
function($delegate) {
// create a new function to be returned below as the $log service 
(instead of the $delegate)
function logger() {
// if $log fn is called directly, default to info message
logger.info.apply(logger, arguments);
}

// add all the $log props into our new logger fn
angular.extend(logger, $delegate);
return logger;
}]); 

}]);

smartApp.run(['$rootScope', 'settings', function($rootScope, settings) {
settings.currentLang = settings.languages[0]; // en
}])

On Monday, October 6, 2014 2:05:57 PM UTC+8, Sander Elias wrote:

 Hi izanywhere,

 AngularJS routes work linear, (As do most routing systems!)
 This means, that as soon a path evaluates as valid, that’s the route being 
 used. 

 in your case, probably nothing goes behind .when('/:page', ...)

 Regards
 Sander
 ​

 

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Separate ng-table pager template from the *.cshtml page and reuse when it requires

2014-10-06 Thread Sampath Lokuge


I'm using ngTable http://bazalt-cms.com/ng-table/ for showing data on my 
ASP.net MVC project.On that directive I use pager template as shown below.

Here is the *Pagination template 
http://bazalt-cms.com/ng-table/example/2.*

!-- Pager Template --
script type=text/ng-template id=custom/pager
ul class=pager ng-cloak
li ng-repeat=page in pages
ng-class={'disabled': !page.active, 'previous': page.type 
== 'prev', 'next': page.type == 'next'}
ng-show=page.type == 'prev' || page.type == 'next' 
ng-switch=page.type
a ng-switch-when=prev 
ng-click=params.page(page.number) href=laquo; Previous/a
a ng-switch-when=next 
ng-click=params.page(page.number) href=Next raquo;/a
/li
li
div class=btn-group btn-group-sm
button type=button 
ng-class={'active':params.count() == 10} ng-click=params.count(10) 
class=btn btn-default10/button
button type=button 
ng-class={'active':params.count() == 25} ng-click=params.count(25) 
class=btn btn-default25/button
button type=button 
ng-class={'active':params.count() == 50} ng-click=params.count(50) 
class=btn btn-default50/button
button type=button 
ng-class={'active':params.count() == 100} ng-click=params.count(100) 
class=btn btn-default100/button
/div
/li
/ul
/script



*My question is how can I separate it from my *.cshtml file and use when it 
needs for the other pages as well ? At this moment where I use same code 
block again and again on each and every page.So if you can simulate your 
solution on Plunk, it's highly appreciate.*

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Directive and stream real time data

2014-10-06 Thread JORDY David
I already have a service for data in real time. This service populate an 
HTML table with a ng-repeat directive. When my mouse is hover a table row 
my custom directive should display same data as my table row with more 
details.

Custome directive
angular.module('TEST').directive('helloWorld', function() {
return {
restrict: 'AEC',
replace: 'true',
template: 'p ng-click=select()Hello World!! 
{{streamData}}/p',

link: function (scope, element, attrs) {   
scope.streamData = 
scope.$parent.models[scope.rowIndex].StreamData;

scope.$watch(attrs.streamData, function(items) {

});
}
};
});

Controller
$scope.onMouseEnter = function ($event, index) {
$scope.rowIndex = index;
var coords = getMouseEventResult($event, Mouse move);

var newElement = $compile('div id=screenshot hello-world 
name=row.StreamData rowIndex=$scope.rowIndex //div')($scope);
angular.element(document.body).append(newElement);

$(#screenshot)
.css(top, (coords.y - xOffset) + px)
.css(left, (coords.x + yOffset) + px)
.fadeIn(fast);
};

I removed  the isolate scope

Thanks for your help

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Angular JS complex Table form creation

2014-10-06 Thread muffin . enok
Hi 
Could any angularjs expert help me to get an answer for this question. 
http://stackoverflow.com/questions/26180112/angular-js-complex-table-form-creation
 Demo 
is also available here: http://plnkr.co/edit/6DcIXm8vb2S6x3IMwM4y?p=preview 

I am using a core angularjs to make a dynamic table form with flexible 
column number and row numbers. 
I appreciate your help in advance. 

Br, Muffin

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Using ngRoute correctly

2014-10-06 Thread Sander Elias
Hi,

Put the route with the highest specificity on top.  In your case, swap 
those 2 routes

Regards
Sander

On Monday, October 6, 2014 9:08:26 AM UTC+2, izanywhere hk wrote:

 Thank you for your reply. I did of course try that first time.. :) Please 
 see code below. Not clear what am I missing..

 var smartApp = angular.module('smartApp', [
   'ngRoute',
   //'ngAnimate', // this is buggy, jarviswidget will not work with 
 ngAnimate :(
   'ui.bootstrap',
   'plunker',
   'app.controllers',
   'app.demoControllers',
   'app.main',
   'app.navigation',
   'app.localize',
   'app.activity',
   'app.smartui',
 'app.f1Controllers',
 'app.f1Services'
 ]);

 smartApp.config(['$routeProvider', '$provide', function($routeProvider, 
 $provide) {
 $routeProvider
 .when('/', {
 redirectTo: '/dashboard'
 })

 /* We are loading our views dynamically by passing arguments to 
 the location url */

 // A bug in smartwidget with angular (routes not reloading). 
 // We need to reload these pages everytime so widget would work
 // The trick is to add / at the end of the view.
 // http://stackoverflow.com/a/17588833

 .when('angular/ui', {
 templateUrl: 'views/angular/ui.html',
 controller: 'PageViewController'
 })

 .when('f1/f1Drivers', {
 templateUrl: 'views/f1/f1Drivers.html',
 controller: 'f1DriversController'
 })

 .when('f1/f1Drivers/:id', {
 templateUrl: 'views/f1/f1Driver.html',
 controller: 'f1DriverController'
 })
 /*
 .when('/:page', { // we can enable ngAnimate and implement the fix 
 here, but it's a bit laggy
 templateUrl: function($routeParams) {
 return 'views/'+ $routeParams.page +'.html';
 },
 controller: 'PageViewController'
 })
 .when('/:page/:child*', {
 templateUrl: function($routeParams) {
 return 'views/'+ $routeParams.page + '/' + 
 $routeParams.child + '.html';
 },
 controller: 'PageViewController'
 })
 */
 .otherwise({
 redirectTo: '/dashboard'
 });

 // with this, you can use $log('Message') same as $log.info
 ('Message');
 $provide.decorator('$log', ['$delegate',
 function($delegate) {
 // create a new function to be returned below as the $log service 
 (instead of the $delegate)
 function logger() {
 // if $log fn is called directly, default to info message
 logger.info.apply(logger, arguments);
 }

 // add all the $log props into our new logger fn
 angular.extend(logger, $delegate);
 return logger;
 }]); 

 }]);

 smartApp.run(['$rootScope', 'settings', function($rootScope, settings) {
 settings.currentLang = settings.languages[0]; // en
 }])

 On Monday, October 6, 2014 2:05:57 PM UTC+8, Sander Elias wrote:

 Hi izanywhere,

 AngularJS routes work linear, (As do most routing systems!)
 This means, that as soon a path evaluates as valid, that’s the route 
 being used. 

 in your case, probably nothing goes behind .when('/:page', ...)

 Regards
 Sander
 ​

  


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] ng-view/Route problem on IE9 for displaying the views

2014-10-06 Thread amadese
 
 I'm a beginner with Angularjs. I'm going to develop an application with 
this framework and Coldfusion for retrieving data from a database. 

I have a problem with the compatibility on IE9 (mandatory and used by 
default in my office). All works in Chrome and Firefox and IE10 and IE11, 
and I do not know why the application does not work on IE9. 

The problem is that the view is not shown when you click on the button in 
the top menu (in order to display all contacts or the view with the form 
for adding a contact). I think that it's a problem with the ng-route 
dependency, but I'm not sure. Or it could be a problem with the feature 
history.pushState...

I'm using the version AngularJS v1.2.23 and the dependency ng-route 
(angular-route.min.js).

Could you please help me to find a solution to this problem and allow to 
the application to work on IE9.

*Here my code:*

   - index.html
   
html ng-app=ContactsApp class=ng-app:ContactsApp id=ng-app

head

meta http-equiv=Content-Type content=text/html; charset=utf-8 /
meta http-equiv=Expires content=0
titleApplication/title 
link rel=stylesheet 
href=lib/css/bootstrap-3.1.1/css/bootstrap.min.css
link rel=stylesheet 
href=lib/css/bootstrap-3.1.1/css/bootstrap-theme.min.css
link rel=stylesheet href=css/styles.css rel=stylesheet
link rel=stylesheet href=css/select.css rel=stylesheet 
/head  
body

div class=container
div class=spacer navbar

h1 class=nav nav-pills navbar-leftApplication/h1

ul class=nav nav-pills navbar-right 
data-ng-controller=NavbarController
li data-ng-class={'active':getClass('/all-contacts')}a 
href=#/all-contactsAll contacts/a/li
li data-ng-class={'active':getClass('/add-contacts')}a 
href=#/add-contactsAdd contacts/a/li
/ul

/div

div ng-view/div

hr/

div class=footer
p@Copy right 2014/p
/div

  /div

  script src=lib/js/angular.min.js/script
  script src=lib/js/bootstrap.min.js/script
  script src=lib/js/jquery.min.js/script
  script src=lib/js/angular-route.min.js/script  
  script src=lib/js/ng-infinite-scroll.min.js/script  
  script src=lib/js/ui-bootstrap-tpls-0.11.0.min.js/script  
  script src=app/app.js/script
  script src=app/appService.js/script
/body
/html



   - app.js

var app=angular.module('ContactsApp', ['ngRoute', 'ui.bootstrap']);
app.config(function($routeProvider){
$routeProvider.when('/all-contacts',
{
  templateUrl: 'template/allContacts.html',
  controller: 'ctrlContacts'
})
.when('/view-contacts/:contactId',
{
  templateUrl: 'template/viewContact.html',
  controller: 'ctrlViewContacts'
})
.when('/search-contacts',
{
  templateUrl: 'template/fastSearch.html',
  controller: 'ctrlContactSearch'
})  
.when('/add-contacts',
{
  templateUrl: 'template/manageContact.html',
  controller: 'ctrlAddContacts'
}) 
.otherwise({redirectTo:'/all-contacts'});  
});

app.controller('ctrlContacts', function ($scope, ContactService){
$scope.contacts=null;
$scope.search = function(searchText) {
if (searchText.length2) {
ContactService.fastSearch(searchText).success(function(contacts){
$scope.contacts = contacts; 
}); 
}else{
$scope.contacts=null;
}
}   

// recherche   
$scope.searchText = null;
$scope.razRecherche = function() {
$scope.searchText = null;
}   

// tri   
$scope.champTri = null;
$scope.triDescendant = false;
$scope.triEmails = function(champ) {
if ($scope.champTri == champ) {
$scope.triDescendant = !$scope.triDescendant;
} else {
$scope.champTri = champ;
$scope.triDescendant = false;
}   
}

$scope.cssChevronsTri = function(champ) {
return {
glyphicon: $scope.champTri == champ,
'glyphicon-chevron-up' : $scope.champTri == champ  
!$scope.triDescendant,
'glyphicon-chevron-down' : $scope.champTri == champ  
$scope.triDescendant 
};
}

$scope.confirmDel = function (id) {
if(confirm('Do you want to delete this contact?')){
ContactService.delContact(id).success(function(){
ContactService.getContact().success(function(contacts){
$scope.contacts = contacts; 
}); 
});
}
$scope.orderby = orderby;
};

$scope.setOrder = function (orderby) {
if(orderby === $scope.orderby){
$scope.reverse = !$scope.reverse;
}
$scope.orderby = orderby;
};

});


[AngularJS] Re: Access to $event.target in directive

2014-10-06 Thread korneliusz wilgocki
This is my complete code, sorry i dont know how to publish plunker.

$event is undefined.

!DOCTYPE html
html ng-app=plunker

  head
  /head

  body ng-controller=MainCtrl
pHello {{name}}!/p

ul
  
  li ng-repeat=child in collection
child child=child/child
  /li
/ul
  /body

/html


var app = angular.module('plunker', []);

app.controller('MainCtrl', function($scope) {
  $scope.name = 'World';

  $scope.collection = [{
id: 1,
name: 'node one',
  }, {
id: 2,
name: 'node two',
  }, {
id: 3,
name: 'node three',
  }, ]
});

app.directive('child', function() {
  return {
restrict: 'E',
replace: true,
scope: {
  child: '='
},
template: 'span ng-click=showGroup($event){{ child.name }}/span',

link: function(scope, element, attrs) {

  scope.showGroup = function(group_id) {
alert($event.target);
  }
}
  }
});

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Access to $event.target in directive

2014-10-06 Thread korneliusz wilgocki
What i want to do is to add active class to clicked span

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Directive and stream real time data

2014-10-06 Thread JORDY David
I found a way but I don't know if it's  the best manner:

On my controller
$scope.$broadcast('streamData', ..);

On my Directive
scope.$on('streamData', function (event, args) {
scope.streamData = args.streamData
});

Any advices ?

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Access to $event.target in directive

2014-10-06 Thread korneliusz wilgocki
http://jsfiddle.net/mLucLuqv/

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Custom filter in ng-repeat ran 1200 instead of 100?

2014-10-06 Thread Mykhaylo Vayvala
I have a an array that holds 100 objects. And with `ng-repeat` I create 
table fill it with data. And I also have a filter function that is 
filtering my table. Initially (on-load) filter values are set so that every 
row from 100 will pass, but later user can change filter values and with 
two-way binding, my table updates automatically. But here is the big 
problem that I do not know how to solve. I have added counter to my filter 
function and instead of running 100 times on-load it ran 1200 times on-load 
and 800 times each time user change filter values. Here is the demo of my 
array (only 10 object and not real data):

$scope.carList = [{name:car, review:250, rating:  4.5, 
fiveStarPercent: 70%, recommended: 90%, 
carLink:http://someurl.com;, price: $1000-$2000, minPrice: 1000, 
maxPrice:2000, type: hatchback},{name:car, review:250, 
rating:  4.5, fiveStarPercent: 70%, recommended: 90%, 
carLink:http://someurl.com;, price: $1000-$2000, minPrice: 1000, 
maxPrice:2000, type: hatchback},{name:car, review:250, 
rating:  4.5, fiveStarPercent: 70%, recommended: 90%, 
carLink:http://someurl.com;, price: $1000-$2000, minPrice: 1000, 
maxPrice:2000, type: hatchback},{name:car, review:250, 
rating:  4.5, fiveStarPercent: 70%, recommended: 90%, 
carLink:http://someurl.com;, price: $1000-$2000, minPrice: 1000, 
maxPrice:2000, type: hatchback},{name:car, review:250, 
rating:  4.5, fiveStarPercent: 70%, recommended: 90%, 
carLink:http://someurl.com;, price: $1000-$2000, minPrice: 1000, 
maxPrice:2000, type: hatchback},{name:car, review:250, 
rating:  4.5, fiveStarPercent: 70%, recommended: 90%, 
carLink:http://someurl.com;, price: $1000-$2000, minPrice: 1000, 
maxPrice:2000, type: hatchback},{name:car, review:250, 
rating:  4.5, fiveStarPercent: 70%, recommended: 90%, 
carLink:http://someurl.com;, price: $1000-$2000, minPrice: 1000, 
maxPrice:2000, type: hatchback},{name:car, review:250, 
rating:  4.5, fiveStarPercent: 70%, recommended: 90%, 
carLink:http://someurl.com;, price: $1000-$2000, minPrice: 1000, 
maxPrice:2000, type: hatchback},{name:car, review:250, 
rating:  4.5, fiveStarPercent: 70%, recommended: 90%, 
carLink:http://someurl.com;, price: $1000-$2000, minPrice: 1000, 
maxPrice:2000, type: hatchbak},{name:car, review:250, 
rating:  4.5, fiveStarPercent: 70%, recommended: 90%, 
carLink:http://someurl.com;, price: $1000-$2000, minPrice: 1000, 
maxPrice:2000, type: hatchback}];

Here is my controller and my filter function:

carApp.controller(TableBodyCtrl, [$scope, $http, function($scope, 
$http){

$scope.selectAll = {selected:true};
$scope.filterValues = {revNum:30,minNum:0,maxNum:0,currentCarType:null};
$scope.modelRow = { activeRow: '' };
$scope.carTypeObj = [];
$scope.showDetails = false;
$scope.carTypeArray = [];
$scope.activeTypeBox = false;

$scope.tableFilter = function(line) {
smartCounter++
console.log(smartCounter);
 var revNum = (($scope.filterValues.revNum===null) ? 0 : 
$scope.filterValues.revNum);
var minNum = (($scope.filterValues.minNum===null) ? 0 : 
$scope.filterValues.minNum);
var maxNum = (($scope.filterValues.maxNum===null) ? 0 : 
$scope.filterValues.maxNum);

var typeBool = false;
for(var i=0;i$scope.carTypeObj.length;i++){
if ($scope.carTypeObj[i][selected]  
$scope.carTypeObj[i][type]===line[type]){
if ($scope.selectAll[selected] === true){
$scope.selectAll[selected] = false;
}
typeBool = true;
}
}

if ($scope.selectAll[selected] === true){
typeBool = true;
}
 var r = line[review] = revNum;
var minP = line[maxPrice] = minNum  line[maxPrice]!=;
if(maxNum!=0){
var maxP = line[minPrice] = maxNum  line[minPrice]!=;
}else{
var maxP = true;
}
$scope.progressBar += 1

return(r  maxP  minP  typeBool  ((line[type] == 
$scope.filterValues.currentCarType) || ($scope.filterValues.currentCarType 
== null)));

}
}]);

And here is my html:

table
  thead
tr
  thCar Model/th
  thReviews/th
  thRating/th
  th5 Star Percentage/th
  thRecommended/th
  thPrice/th
/tr
  /thead
  tbody
tr ng-repeat-start=car in carList | filter:tableFilter
  td{{car.name}}/td
  td{{car.review}}/td
  td{{car.rating}}/td
  td{{car.fiveStarPercent}}/td
  td{{car.recommended}}/td
  td{{car.price}}/td
/tr
  /tbody
/table

How can I fix this issue:

*Angular version: v1.2.25*

UPDATE:

I am using `ng-repeat-start` because each car object has another object 
that holds car reviews by year of car registration and I want to show this 
table when user click on the row:

tr ng-repeat-end ng-show=modelRow.activeRow==car.name  showDetails 
 car.allReviews.length!=0 class=hidden-table
td colspan=6
table class=table table-striped table-bordered table-condensed 
table-hover
thead
tr
thYear/th
thReviews/th
thRating span class=fiveStar/5/span/th
thRecommended/th
thReliability Rating span class=fiveStar/5/span/th
thPerformance Rating span class=fiveStar/5/span/th

Re: [AngularJS] Re: Access to $event.target in directive

2014-10-06 Thread korneliusz wilgocki
OK i did it in this way

scope.showGroup = function(group_id) {
  angular.element('.section-name').removeClass('active');

element.find('.elements').first().find('span.section-name').addClass('active');
}



2014-10-06 10:50 GMT+02:00 korneliusz wilgocki 
korneliusz.wilgo...@gmail.com:

 http://jsfiddle.net/mLucLuqv/

  --
 You received this message because you are subscribed to the Google Groups
 AngularJS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to angular+unsubscr...@googlegroups.com.
 To post to this group, send email to angular@googlegroups.com.
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] ngRoute keeps refreshing the page. Please help

2014-10-06 Thread Greg Jang
I think I figured out why the page kept refreshing and I it was because I
had an action on the html form.

form action={{destination}}
   
/form

so when I press the button to take me to the next view the damn page kept
reloading and resetting all my factory variables.
Can't believe this problem was all because of HTML and nothing to do with
angularJS.

best,
greg





On Mon, Oct 6, 2014 at 11:23 AM, Greg Jang gregj...@gmail.com wrote:

 thank you for the help!
 I'll check into service()
 fingers crossed

 On Sun, Oct 5, 2014 at 6:04 AM, Daniel Johnson tekno...@gmail.com wrote:

  function formStorageFunc() {
return {};
  }
  angular.service('formStorage', formStorageFunc);
 
  // in directive
  $scope.formData = formStorage();

 Forgot to past reference URL

 http://stackoverflow.com/questions/14324451/angular-service-vs-angular-factory

 --
 teknotus (Take Notice)

 --
 You received this message because you are subscribed to a topic in the
 Google Groups AngularJS group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/angular/X05M1QWptAk/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 angular+unsubscr...@googlegroups.com.
 To post to this group, send email to angular@googlegroups.com.
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.




 --
 Sent from my desktop!




-- 
Sent from my desktop!

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Alternative way to IE9 support $routeProvider route loading without $locationProvider.html5Mode

2014-10-06 Thread amadese
Hi,

I have the same problem with the route in Angular, could you tell me please 
if you have found a solution to this problem?

Regards,

Sebastien

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Directive and stream real time data

2014-10-06 Thread Sander Elias
Hi Jordy,

Well, it is a way. I don't know if its the best way in your situation, 
without seeing the rest of the code.

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Custom filter in ng-repeat ran 1200 instead of 100?

2014-10-06 Thread Sander Elias
Hi Mykhaylo,

Perhaps you are better of with an custom filer in this case. I'm not too 
sure tough. This kind of question should have a plunk illustrating the 
issue.
If you would have included a plunk, I would have too a deeper look into 
this.

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: minification of angularjs itself

2014-10-06 Thread Johan Dindaine
I got the resource from bower, could that be the problem?

2014-10-06 5:26 GMT+01:00 Sander Elias sanderel...@gmail.com:

 Hi Johan,


 Concatenating the minified version should give you no problem. However,
 you should take care on
 the ordering of your resources. If you for example put angular-route
 before angular itself, you might
 get the error you are experiencing.

 the same issue goes on of you do the build and minify the libraries
 yourself. This is however not
 recommend, there are some issues that you should take in account if you
 want to minify angular yourself.

 Regards
 Sander Elias

 --
 You received this message because you are subscribed to the Google Groups
 AngularJS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to angular+unsubscr...@googlegroups.com.
 To post to this group, send email to angular@googlegroups.com.
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: Access to $event.target in directive

2014-10-06 Thread Sander Elias
Hi,

Here is a alternative 
way: http://plnkr.co/edit/300piXZILuUnWpthGWIN?p=preview
In this way, you are ot relaying on the DOM for app logic, but you keep it 
in a controller.

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: minification of angularjs itself

2014-10-06 Thread Sander Elias
Hi Johan,

No, that's not the problem. The problem is the order in wich you 
concatenate your files. AngularJS should go first.

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: ngHide/ngShow digestion problem

2014-10-06 Thread Jonathan Bräuer
Hi Sander,

thank you for your answer, but the '$' wasn't the problem, as the same 
behavior happened on other properties as well in other locations.

I decided to use ngIf now, as it makes sense anyway (I just didn't really 
know it existed previously) and it works fine. I'm still thinking that it 
might be an angular bug as changing:

!-- CHANGING: --
div ng-show=someVar.something/div

!-- TO: --
div ng-if=someVar.something/div

was enough to make it disappear.
I will keep my eyes open and try to recreate it in a fiddle. I'm still 
confused about it.

Best,
Johnny


On Monday, October 6, 2014 7:09:27 AM UTC+2, Sander Elias wrote:

 Hi Jonathan,

 It’s difficult to say anything about this, without having a reproducible 
 example. While researching your bug, I found nothing that could explain 
 this.
 If you have a a spot in your system where you can test this, can you try 
 testing it without a $ in the resource name? Meaning, replace
 scope.someInstance.$resolved with something like 
 scope.someInstance._resolved. I have a gut feeling this might help. Its a 
 70/30 change. So don’t

 get your hopes up too much.

 Regards
 Sander
 ​


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Using ngRoute correctly

2014-10-06 Thread Jens Melgaard
@Sander You don't have to do that.

The angular routing system doesn't do a wildcard all at the end unless you 
ask it to with a *, so 'f1/f1Drivers' won't match 'f1/f1Drivers/10', the 
next route 'f1/f1Drivers/:id' will however...
Simple demo of that at: http://plnkr.co/edit/Ul1HSsgsfCLRxOh05b84?p=preview

(the about page, we define '/about' first, then '/about/:id' and all works 
well)...

@izanywhere

Which version of angular? And i ofc. assume you have loaded 
angular-route.js as well...

Your first example, with the '/:page/:child*' and '/:page' those two 
literally captures everything in your page...
Lets take the second one first... 

'/:page' will capture every route that has no '/' or one only in the 
beginning... this includes: '/foo', '/bar', '/boguslungus' etc... 

Now for the more interesting on in your case... 

'/:page/:child*' will capture everything with a single or more '/', (or two 
and more with the same exception as above)...
This means that it will capture: '/foo/bar', '/hocus/pocus' and 
also 'angular/ui', 'ex_F1/f1Drivers', now because of the * there at the 
end, it will also capture: '/foo/bar/baz' and  '/foo/bar/baz/taz' and in 
effect also 'ex_F1/f1Drivers/f1Driver/:id'
Which becomes your problem.

Try to create a plunker with your specific problem...
Here is two examples, one for 1.2.16 and one for 1.3.0-rc4

http://plnkr.co/edit/Ul1HSsgsfCLRxOh05b84?p=preview
http://plnkr.co/edit/ehGUVRiEzxUiFMrQYeDv?p=preview

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: templateURL and route config fails sporatically

2014-10-06 Thread Jens Melgaard
Just a little FYI / Hint...  When you define controller as a string, you 
can just use the controller as syntax, meaning you don't have to define the 
controllerAs property...

controller: 'ProfileCtrl as profile' works fine... controllerAs is usefull 
when you define controller as a function directly... (for whatever reason).


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] How to change sidebar width (for mobile screen - vertical rect) in mobile AngularJS

2014-10-06 Thread Simon Li
Dear all,

How can I change sidebar width (for mobile screen - vertical rect) in 
mobile AngularJS ? So that it will looks less width on mobile?

Simon.

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Beyond JSON: Introducing the Spearal Serialization Protocol (with an AngularJS / Java EE demo)

2014-10-06 Thread Franck Wolff
Hi,

I have published an article on DZone showing how you can use and benefit 
from the new Spearal serialization protocol instead of JSON with AngularJS: 
http://architects.dzone.com/articles/beyond-json-introducing.

Spearal allows data graph circularity, references, partial object 
serialization, built-in support for JPA uninitialized associations, 
divergent models reconciliation and object properties filtering.

Regards,
--
Franck
http://spearal.io
@Spearal https://twitter.com/Spearal

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Directive and stream real time data

2014-10-06 Thread JORDY David
My directive works fine but when I add this directive dynamicaly on my web 
page I lost all the binding 

Le lundi 6 octobre 2014 12:46:19 UTC+2, Sander Elias a écrit :

 Hi Jordy,

 Well, it is a way. I don't know if its the best way in your situation, 
 without seeing the rest of the code.

 Regards
 Sander


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: minification of angularjs itself

2014-10-06 Thread Johan Dindaine
I thought that Jquery needed to come first so that angular avoid using its
jqlite then angularjs then angular-route and so on.

2014-10-06 12:38 GMT+01:00 Sander Elias sanderel...@gmail.com:

 Hi Johan,

 No, that's not the problem. The problem is the order in wich you
 concatenate your files. AngularJS should go first.

 Regards
 Sander

 --
 You received this message because you are subscribed to the Google Groups
 AngularJS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to angular+unsubscr...@googlegroups.com.
 To post to this group, send email to angular@googlegroups.com.
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: minification of angularjs itself

2014-10-06 Thread Tony pee
yes, this is true. Jquery, angular, angular modules, etc.

I use uglify over my dependencies like this and have no issues, in even
your most basic test things fail?

On 6 October 2014 09:41, Johan Dindaine jojolapin...@gmail.com wrote:

 I thought that Jquery needed to come first so that angular avoid using its
 jqlite then angularjs then angular-route and so on.

 2014-10-06 12:38 GMT+01:00 Sander Elias sanderel...@gmail.com:

 Hi Johan,

 No, that's not the problem. The problem is the order in wich you
 concatenate your files. AngularJS should go first.

 Regards
 Sander

 --
 You received this message because you are subscribed to the Google Groups
 AngularJS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to angular+unsubscr...@googlegroups.com.
 To post to this group, send email to angular@googlegroups.com.
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google Groups
 AngularJS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to angular+unsubscr...@googlegroups.com.
 To post to this group, send email to angular@googlegroups.com.
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.




-- 
Tony Polinelli

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Model Change Detection: Object.observe Polyfill vs Angular Dirty Checking

2014-10-06 Thread santiago esteva
In this comparison the both frameworks need to register a watcher/observer 
and then the model is updated.
I can see how dirty checking when using polyfills is head to head in some 
browsers.

http://jsperf.com/polymer-comparison

Let me know what you think.


On Friday, October 3, 2014 9:09:21 AM UTC-5, Sander Elias wrote:

 Hi Santiago,

 You are comparing entirely different things. 
 In the angular part, you force a $digest., and the polymer part you are 
 just calling the task that does the watching.
 basically you compare a full update with a check that checks if there is a 
 need to do a more comprehensive test. and that later one might update the 
 UI.
 There happens a lot under the hood in both frameworks. Both have their 
 strengths and weaknesses. 
 I doubt that when you compare a real application in both, there will be a 
 large difference in performance. 
 And do not forget, AngularJS is in production, while Polymer is in 
 developer preview. I'm not sure what that means, but I suspect that's not 
 even in beta ;)

 Regards
 Sander





-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Is it possible to use relative paths (to use images) inside include?

2014-10-06 Thread Mohamed Kamal Kamaly
Sorry to reply on an old post, but I was having the same issues that the 
paths inside a
partial are relative to index.html not the partial location, so I created a 
module that allows that.

https://github.com/mohamedkomalo/angular-relative-paths-in-partial

Thanks

On Friday, February 22, 2013 4:09:41 PM UTC+2, icetbr wrote:

 Hi, I have something like
 \index.html
 \templ\page1.html
 \templ\image1.jpg

 If I include page1.html inside index.html, and page1.html have img 
 src=image1.jpg /, it will not work.

 Thanks


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] What is the value of Protractor over plain Selenium WebDriver?

2014-10-06 Thread David Karr
I'm having trouble finding anything that clearly states from a high level, 
why someone should use Protractor for writing e2e tests for AngularJS 
applications, as opposed to just using Selenium WebDriver to connect to a 
deployed instance of the app.  I imagine a statement to this effect is 
implicitly buried in multiple places in the Protractor documentation, but 
I'm really looking for a high-level statement that addresses this.

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: What is the value of Protractor over plain Selenium WebDriver?

2014-10-06 Thread David Karr
On Monday, October 6, 2014 1:53:51 PM UTC-7, David Karr wrote:

 I'm having trouble finding anything that clearly states from a high level, 
 why someone should use Protractor for writing e2e tests for AngularJS 
 applications, as opposed to just using Selenium WebDriver to connect to a 
 deployed instance of the app.  I imagine a statement to this effect is 
 implicitly buried in multiple places in the Protractor documentation, but 
 I'm really looking for a high-level statement that addresses this.


I did notice that the main Protractor page has the following statements:
*  Protractor supports Angular-specific locator strategies
* You no longer need to add waits and sleeps to your test

Is this the essential value proposition for Protractor over plain Selenium 
WebDriver?

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Angular + Boostrap Datepicker, disable dates dynamically

2014-10-06 Thread Andreas Klintberg
Had this exact problem and wrote a question on Stackoverflow for this which 
was unanswered for about 1 month until I found the solution in a comment 
and plunkr for another similar question and did a writeup: 
http://stackoverflow.com/questions/24985387/disable-dates-using-factory-response-ui-bootstrap-datepicker/26226210

Hope it helps,
BR/Andreas

Den onsdagen den 20:e augusti 2014 kl. 09:57:32 UTC+2 skrev Андрей Скрыпник:

 Hi, i have next question. I need to disable dates in Datepicker object 
 dynamically. I know that exist next method:

   $scope.disabled = function(date, mode)

 but as i understood it work just when page is loading. 

 I need that it work by next scheme for example:

 1. I open site
 2. click button
 3. Make request to server and receive an array of dates to be disabled
 4. showed Modal dialog with Daticker and disabled received dates in it

 How to do it properly ?

 Thanks


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Manning Angular books will be deal-of-the-day on 10/9

2014-10-06 Thread David Aden
Pretty exciting that the first couple of chapters of the Manning 
Publications book Jason and I have been working on, *Angular in Depth*, is 
going to be the MEAP deal-of-the-day on 10/9 along with *Angular in Action* 
and *Ionic in Action*. Deal code will be: dotd100914au

We're definitely looking forward to feedback to make sure the book bridges 
the gap between Angular developer and Angular expert. We want the book, as 
the title suggests, to go into depth and part of that is to strip back the 
pieces and look at exactly what is happening behind the scenes. As we're 
writing it and making diagrams to represent the key pieces, particularly 
beginning with Chapter 3 which should be available soon, we're finding 
things are getting simpler, usually a good sign. But, in the end, we're 
more interested in whether you find it useful so definitely give us your 
ideas and feedback. 

Angular in Action is at: http://www.manning.com/bford/
Ionic in Action is at: http://www.manning.com/wilken/
Angular in Depth is at: http://www.manning.com/aden/

d  


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Regarding ng-repeat, ng-class, and jQuery UI Draggable

2014-10-06 Thread Aaron Hatch
I use ng-repeat to present a list of songs. I use ng-class to determine 
which songs should have a song-unavailable class. I also have a draggable 
directive for jQuery UI.

li ng-repeat=song in songs ng-class={'song-unavailable' : song.owned 
=== true}  draggable

myApp.directive('draggable', function() {
return {
restrict:'A',
link: function(scope, element, attrs) {
element.draggable({
revert: false,
helper: 'clone',
appendTo: '#my_table',
zIndex:1000,
cursorAt: { left: 50 },
start: function(event, ui) {
$('body').css('cursor', 'move');
},
});
}
};
});

Here's the problem: I only want songs to be draggable if song.owned === 
true. However, the directive is initialized before the ng-class expression 
is evaluated. So, all songs have the directive and are draggable. What can 
I do to prevent songs that aren't owned to not be draggable?

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Angularjs overwriting content type in delete method.

2014-10-06 Thread Alexandre Oliveira

I am using angular angular at version 1.3 and I can't configure the  
content-type in delete methods, when I see the request, doesn't have any 
content type.
Why the angular is overwritting the content type?
I have a code like that, and doesn't work.


 $resource('/avaliacaoinstitucional/rest/meta/global/:id', {}, {
'delete' : {
method : 'DELETE',
headers : {
'Content-Type' : 'application/json',
isArray : false
}
}
...



-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Scope Gurus: Directive getting $destroy event, but scope not getting $destroy called

2014-10-06 Thread Jesse Wolfe
OK, I'll post an update to this issue.

To the best of my ability, it seems what's happening is that the main scope 
for the element (not the semi-isolate scope for the grid directive) gets 
$destroy()d.  However, the child scope which is using that scope as the 
prototype is most likely bailing out of the $destroy method early, because 
self.$$destroyed is true (prototypal inheritance). So listeners and 
watchers do not get cleared.

I probably could update the directive to be fully isolate in scope, but I 
don't have time to sort out the implications of that.

I also found it's more than just $destroy.  The $scope itself has a LOT of 
functions defined on it by the directive that form closure around internal 
vars that hold a lot of memory. 

So, I wrote a service that supplies additional cleanup that is easily 
injected into the questionable grid directive. I have a plunk demo'ing it 
here http://plnkr.co/edit/r2uTKTJW2yJTbHx0kXYB.  Now, you can switch 
grids all you like and none but the current grids will remain on the heap.

Hope this helps someone going forward,

J

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Regarding ng-repeat, ng-class, and jQuery UI Draggable

2014-10-06 Thread Justin Walsh
Hi Aaron

Something like this http://plnkr.co/edit/lVtrMj ?

(I haven't added the class based on the ownership, but that should be 
trivial)

Justin

On Tuesday, October 7, 2014 3:20:34 AM UTC+2, Aaron Hatch wrote:

 I use ng-repeat to present a list of songs. I use ng-class to determine 
 which songs should have a song-unavailable class. I also have a draggable 
 directive for jQuery UI.

 li ng-repeat=song in songs ng-class={'song-unavailable' : song.owned 
 === true}  draggable

 myApp.directive('draggable', function() {
 return {
 restrict:'A',
 link: function(scope, element, attrs) {
 element.draggable({
 revert: false,
 helper: 'clone',
 appendTo: '#my_table',
 zIndex:1000,
 cursorAt: { left: 50 },
 start: function(event, ui) {
 $('body').css('cursor', 'move');
 },
 });
 }
 };
 });

 Here's the problem: I only want songs to be draggable if song.owned === 
 true. However, the directive is initialized before the ng-class expression 
 is evaluated. So, all songs have the directive and are draggable. What can 
 I do to prevent songs that aren't owned to not be draggable?


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.