Here is a great infographic that is very useful when choosing an adequate JS framework for your projects: http://www.webdesigndegreecenter.org/choosing-javascript-framework/
Hi, my name is Jhon Jario Roa and this is my blog. Here you'll find a little bit of java, python, javascript, linux, birt, jasper, objective C, extJS and other stuff. You also are gonna find some solutions that worked for me.
Showing posts with label angularJS. Show all posts
Showing posts with label angularJS. Show all posts
Thursday, September 10, 2015
Wednesday, November 12, 2014
Angularjs update migration : getting function parameters from template
Using angular 1.2.0-rc.3 with this code
// html
...
<div ng-repeat="row in rowdata">
<a ng-click="getDetailedListing('{{row._id.$oid}}');">Details</a>
</div>
...
//angular js controller
$scope.getDetailedListing = function(listingId) {
console.log(listingId);
}
When the user clicks the 'a' element, in the console is printed the listingId ie. 54613ed26fb36f26e5ab41a8
But when we upgrade the angular version to 1.2.26, the same code printed {{row._id.$oid}} instead of the listing id. So the fix was changing the a element a little bit:
<a href="javascript:;" ng-init="listingId=row._id.$oid" ng-click="getDetailedListing(listingId);" >Details</a>
Reference
http://stackoverflow.com/questions/18694827/calling-a-scope-function-from-an-ng-include-template-passing-template-value-as-p
// html
...
<div ng-repeat="row in rowdata">
<a ng-click="getDetailedListing('{{row._id.$oid}}');">Details</a>
</div>
...
//angular js controller
$scope.getDetailedListing = function(listingId) {
console.log(listingId);
}
When the user clicks the 'a' element, in the console is printed the listingId ie. 54613ed26fb36f26e5ab41a8
But when we upgrade the angular version to 1.2.26, the same code printed {{row._id.$oid}} instead of the listing id. So the fix was changing the a element a little bit:
<a href="javascript:;" ng-init="listingId=row._id.$oid" ng-click="getDetailedListing(listingId);" >Details</a>
Reference
http://stackoverflow.com/questions/18694827/calling-a-scope-function-from-an-ng-include-template-passing-template-value-as-p
Wednesday, October 22, 2014
Angular JS: directives executing controller methods
There is a nice and pretty straightforward example:
https://thinkster.io/egghead/directives-talking-to-controllers/
https://thinkster.io/egghead/directives-talking-to-controllers/
Sunday, October 19, 2014
Tuesday, October 7, 2014
Share data among controllers
Use $ rootScope
var app = angular.module('mymodule',[]);
app.controller('Ctrl1', ['$scope','$rootScope',
function($scope, $rootScope) {
$rootScope.showBanner = true;
}]);
app.controller('Ctrl2', ['$scope','$rootScope',
function($scope, $rootScope) {
$rootScope.showBanner = false;
}]);
Source:
http://stackoverflow.com/questions/20181323/passing-data-between-controllers-in-angular-js
var app = angular.module('mymodule',[]);
app.controller('Ctrl1', ['$scope','$rootScope',
function($scope, $rootScope) {
$rootScope.showBanner = true;
}]);
app.controller('Ctrl2', ['$scope','$rootScope',
function($scope, $rootScope) {
$rootScope.showBanner = false;
}]);
Source:
http://stackoverflow.com/questions/20181323/passing-data-between-controllers-in-angular-js
Subscribe to:
Posts (Atom)