angularjs-scope

how to edit column in value in angular js?

你离开我真会死。 提交于 2019-12-24 01:19:31
问题 I am using UI-grid in my example .I saw the documentation from here of edit row . http://ui-grid.info/docs/#/tutorial/205_row_editable In given example user able to edit the columns present in row.I also make same example also include modules but not able to edit my columns ..what is procedure to edit the columns ? here is my code http://plnkr.co/edit/zypDrZeJUx9ZoTHNnMxc?p=preview already added the modules angular.module('app',['ngTouch', 'ui.grid', 'ui.grid.selection' ,'ui.grid.edit', 'ui

Access isolated scope in angular directive template

家住魔仙堡 提交于 2019-12-24 00:43:09
问题 I am currently writing an angular directive that uses a template in a different HTML file and an isolated template. The directive gets some string via @ to its scope and that value is available in teh controller function. Somehow its not available via {{}} in the HTML template. Why is that so? How can I change that? I read something about the template using the parent scope but I don't fully understand that. Here is a code example: angular.module('moduleName') .directive('aGreatDirective',

AngularJS: Directive isolate scope - scope variable undefined

不打扰是莪最后的温柔 提交于 2019-12-23 18:53:43
问题 Please, can someone explain me, why attrDir 's scope variable is visible, and oneWay 's not? I thought that scope: {} is isolated as well. angular.module('test', []); angular.module('test').directive('attrDir', attrDir); function attrDir(){ return { scope: true, link: function(scope){ scope.hello = 'attrDir'; } }; } angular.module('test').directive('oneWay', oneWay); function oneWay(){ return { scope: { data: '<?' }, link: function(scope){ scope.hello = 'oneWay'; } }; } hello will be rendered

How to fix unexpected arguments passing from a function being on ng-change for select list?

我怕爱的太早我们不能终老 提交于 2019-12-23 18:01:18
问题 http://plnkr.co/edit/fFSoLmPFDBfNc2oOczZr?p=preview Directive code .directive('inputSelect', function() { return { templateUrl: 'someTemplate.html', restrict: 'E', scope: { ngModel: '=', ngChange: '&', options: '=' } }; }) Controller code $scope.someFunction = function(name) { console.log(name) }; $scope.colors = [{ name: 'black', shade: 'dark' }, { name: 'white', shade: 'light', notAnOption: true }, { name: 'red', shade: 'dark' }]; Template code <select ng-model="ngModel" ng-change="ngChange

Loading map to ngSwitch child scope using ElementRef in Ionic

对着背影说爱祢 提交于 2019-12-23 17:09:41
问题 I'm trying to access a ngSwitchCase view using @ViewChild and ElementRef to load a google map in my Ionic 3 app. I understand the ngSwitch creates its own scope but is it not accessible in anyway so I can load the map from google to the #map id="map" div in the mapView ngSwitchCase ? page.ts //the import import { ElementRef, ViewChild } from '@angular/core'; @Component({ selector: 'page-views', templateUrl: 'views.html' }) export class ViewsPage { //the attribute in the export class

Angular Controller As Syntax-no method '$watchCollection'

别说谁变了你拦得住时间么 提交于 2019-12-23 17:04:06
问题 I am trying to do Controller As Syntax in Angular. At this point, I have it in my routerProvider...not sure if it would matter for the issue I am having, but here it is anyways: angular.module('ucp.kick', [ 'ngRoute' ]) .config ($routeProvider, APP_BASE_URL) -> $routeProvider .when APP_BASE_URL + 'kicks', name: 'Kicks' templateUrl: 'kick/partials/kick.html' controller: 'kick as KickController' Here is a condensed version of my controller I have: this.$watchCollection('filtered.devices',

Being wrapped by a directive, how can I access its scope?

只愿长相守 提交于 2019-12-23 17:02:07
问题 How can I access the directive's isolate scope in the directive's body? My DOM looks like this: <div ng-app="app"> <directive> <p>boolProperty: {{boolProperty|json}}</p> </directive> </div> The boolProperty is assigned inside the directive's link function: angular.module("app", []).directive("directive", function() { return { scope: {}, link: function($scope) { $scope.boolProperty = true; } }; }); The problem is, the child <p> inside the directive binds to the directive's parent scope, not

AngularJS: pushing new data to $scope.myList, top

别来无恙 提交于 2019-12-23 13:39:12
问题 What is the right to add new content to $scope.myList = [] , when I want to manipulate the DOM? I've tried $scope.myList.push(data); , which adds the new data at the end, and therefore in the end of the HTML-template inside ng-repeater. I want it at the top. unshift-function will rearrange the array and update all elements. New to angular. EDIT: Maybe instead the question should be: How should I add new content dynamically into the top of my template? 回答1: Whenever you want to prepend to an

Passing data from ng-click within directive into a function in the controller

只愿长相守 提交于 2019-12-23 13:01:12
问题 I found this question which gets me almost to where I need to be. Why doesn't ng-click work in my directive and how do I add a toggle class? Which makes it so my ng-click within my directive template triggers a function in my controller. http://plnkr.co/edit/GorcZZppa8qcIKbQAg2v?p=preview The issue is that the parameter returned to my controller (item) is undefined . I need this to actually pass data from a variable within my directive to be used in the function that I will run in the

AngularJS ng-repeat array with unique $scope variables per item

杀马特。学长 韩版系。学妹 提交于 2019-12-23 12:54:18
问题 So I am building a food order form and I have a list of options that need to be attached to the individual item index and not to the parent.. As of right now everything works but when i add an option to one product in the array all products have the same value added... ie.. if i choose the vanilla option for latte all drinks in the ng-repeat array will have the vanilla option set to true.. here is what i have.. first here is the html markup of the options view <md-card ng-repeat="item in