back soft

مطالب مرتبط با «angular 2» در back soft | نویسنده: استخدام کار

Angular 2 - rc.2 packages not installing correctly

Vote count: 0 I am trying to update to Angular 2 rc 2 using the command npm install --save @angular/core @angular/compiler @angular/common @angular/platform-browser @angular/platform-browser-dynamic rxjs@5.0.0-beta.6 zone.js@0.6.12, but it not installing correctly it seems. In node_modules/@angular/core, core.umd.js is not found. In node_modules/@angular/common, common.umd.js is not found. the same thing for others too. Can anyone help me to solve this? Thanks in advance asked 58 secs agoAbraham Gnanasingh Let's block ads! بخوانید...

ادامه مطلب

Angular2 @angular/router 3.0.0-alpha.3 - How to get the current route name

Vote count: 0 I'm trying to get the current route name in my app.component so that I can use the route name as a page class around a wrapper div. I'm trying to figure out the best way to handle this. Previously I was subscribing the the router changes property like I have listed below, but it seems like is no longer available with @angular/router 3.0.0-alpha.3. If anyone has any thoughts or suggestions I would be most grateful. this.router.changes.subscribe((val) => { var path = this._location.path(); if (path.indexOf('page-name') !== -1) { this.pageClass = 'page-name'; } }) asked 57 secs agoRyan Robison Let's block ads! بخوانید...

ادامه مطلب

Angular2 add styling when id of object > 100

Vote count: 1 I have object markers with all different Id's, now I want to set extra styling when the id > 100 Here the code is: {{ result.resource.display_name }} But how do I add extra styling like style="left: 12px" asked 6 mins agoBegierprogrammer 1 Answer Vote count: 1 You can bind to a style conditionally like or If you don't want to set a style at all if id noStyle = {}; gT100Style = {left: '12px'}; getStyle(id) { retu id > 100 ? this.gT100Style : this.noStyle; } It is important, that noStyle and gT100Style are defined outside getStyle() otherwise change detection would cause troubles because every call would retu a new style object instance. answered 3 mins agoGünter Zöchbauer Let's ...

ادامه مطلب

Angular with html code editor now working

Vote count: 0 I am working on code editor using angular js, here i have my code but i want the editor to load content on textarea once page load or if the content of the text is change. i have I archive it to display everything that is typed in editor inside the textarea but from text area to editor is not working var app = angular.module('app', []); app.controller('ctrl', [ '$scope', function ($scope) { ace.config.set('basePath', '//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/'); } ]); app.directive('aceCodeEditor', [function () { retu { link: function (scope, element, attrs) { scope.editor = ace.edit(element[0]); scope.editor.getSession().setMode('ace/mode/markdown'); scope.editor.setTheme('a...

ادامه مطلب

How to hide/show elements in Angular like JQuery by passing element class to the function?

Vote count: 0 I searched about my problem, and I could not find my answer and I'm just looking for the solution with the best performance and less code. I have some drop-down menus and I want to have just one function to show and hide the menus on click on their buttons, by JavaScript or by JQuery this is simple and does not add more codes (atributes) to the HTML elements and it means lighter DOM. Imagine these are my buttons, actually my links (HTML): First link Second link Third link This is first MENU This is Second MENU This is Third MENU And this can be my JQuery: $("a").click(function() { var class_name = $(this).attr('class'); $("div").hide(); $("." + class_name + '-div').show(); }); ...

ادامه مطلب

angular ui-grid not painting background color in a cell only in internet explorer

Vote count: 0 I have below column def, and I am using this to change the color of the row. But for some reason on inteet explorer the comments column does not gets colored. It stays white background, however it changes when i scroll to left and right. Any suggestions to fix it? [ { "name" : "dqId", "displayName" : "DQ Issue ID", "width" : "10%", "visible" : true, "cellTemplate": " {{row.entity.dqId}} " },{ "name" : "SeqNO", "displayName" : "Seq NO", "width" : "5%", "visible" : false, "cellTemplate": " {{row.entity.SeqNO}} " },{ "name" : "issueTypeNames", "displayName" : "DQ Issue Types", "width" : "30%", "visible" : true, "cellTemplate": " {{row.entity.issueTypeNames}} " },{ "name" : "commen...

ادامه مطلب

Angular 2: can not find @angular modules in RC 1 version

Vote count: 0 I started writing angular2 application with RC1 version. As described in the angular.io docs I created separate system.config.js file in the root. // system.config.js (function (global) { var map = { 'app': 'app', 'rxjs': 'node_modules/rxjs', '@angular': 'node_modules/@angular' }; var packages = { 'app': {main: 'main.js', defaultExtension: 'js'}, 'rxjs': {defaultExtension: 'js'} }; var packageNames = [ '@angular/common', '@angular/compiler', '@angular/core', '@angular/http', '@angular/platform-browser', '@angular/platform-browser-dynamic', '@angular/router' ]; packageNames.forEach(function (pkgName) { packages[pkgName] = {main: 'index.js', defaultExtension: 'js'}; }); var confi...

ادامه مطلب

AngularJS $interval start and cancel going haywire

Vote count: 0 I am trying to make a "slider" - content changing on interval. I want the content to change at the interval, and then when hover over with mouse it pauses, and continues when you mouseout. Also there are buttons at the bottom, one for each content item, when you click one, it cancels the interval, moves to that item and then starts moving through the content again from that item. ...pretty standard. Right now, it begins by going through the content fine, and the mousein/out pausing works fine, but when I click one of the buttons to skip to that item the interval speed starts going haywire and I can no longer pause it when hovering over it. I have console logged my cancel functi...

ادامه مطلب

Karma Coverage not finding files (angular2 / typescript)

Vote count: 0 I am working on getting an app set up using Angular 2 w/ typescript and I'm having issues getting my karma coverage to find the files I want it to inspect. I've set this up successfully on an angular 1.x application but there seems to be another layer I'm missing with typescript. Everything runs just fine, I see all of my unit tests being checked by karma as expected and coverage says everything was okay and that my code has 100% coverage, which threw up a red flag. After checking the html output for coverage I saw that I have 100% coverage because no files are being checked. Looking at the output in my terminal I see that all of the files I have selected with patte: './src/**/...

ادامه مطلب

AngularJS Filter in MattLewis Angular Bootstrap Calendar

Vote count: 0 I want to achieve a searching for event inside the MattLewis Angular Bootstrap Calendar from this https://github.com/mattlewis92/angular-bootstrap-calendar I already set up everything, the filters work but it just give me a bunch of error that causes my other functions did't work well. Here is code for calendar HTML Controller $scope.events = [ { title: 'An event', type: 'waing', startsAt: moment().startOf('week').subtract(2, 'days').add(8, 'hours').toDate(), endsAt: moment().startOf('week').add(1, 'week').add(9, 'hours').toDate(), draggable: true, resizable: true }, { title: ' Another event, with a html title', type: 'info', startsAt: moment().subtract(1, 'day').toDate(), ends...

ادامه مطلب

Advantages and Disadvantages of RequireJS in AngularJS App SEO

Vote count: 0 I am implementing a large scale AngularJS Application using RequireJS as AMD(Asynchronous Module Definition) to manually load my dependencies ans libraries. After carrying some research on AngularJS-Search Engine Optimization, I am wandering if RequireJS can have some negative impact on Angular-SEO since it crap all plugins and pass only the mainjs file to the index.html Please i am newbie RequireJS. I need your advices and thoughts. Thanks, asked 49 secs agotony pro Let's block ads! بخوانید...

ادامه مطلب

Splicing angular filter result results in infinite digest

Vote count: 0 I have a custom filter: controllers.filter('myFilter', function($document, $timeout) { retu function(items) { // Sort all by date items.sort(function(a, b) { retu (b.createdAt ? b.createdAt : b.start_time) - (a.createdAt ? a.createdAt : a.start_time); }); var filtered = []; angular.forEach(items, function(item) { if(item.hasOwnProperty("accuracy")) { filtered.unshift(item); } else { if (!item.isHidden) { filtered.push(item); } } }); retu filtered; }; }); This works all nice dandy, but produces an infinte digest loop if I retu only the top 10 results: retu filtered.splice(0, 10). Why is this, and can I somehow only retu the top 10 without having this thing implode? Also, oddly, ...

ادامه مطلب

implement tympanas slip from top modal effect in angularjs

Vote count: 0 can anyone help me from here to guide me how to implement tympanas slip from top modal effect in admin theme ?. am struggling to get that effect in my dashboard for past 10 days. thanks for your heads up asked 2 mins agobeep Let's block ads! بخوانید...

ادامه مطلب

How do i read the property of a JSON object defined in a AngularJS factory

Vote count: 0 I have defined a factory in AngularJS similar to the following: angular.module("myApp").factory(function (){ var userObject = { userID: '', email: '', }; userObject.isLoggedIn = function(){ if(userObject.email === '') retu false; else retu true; }; //more code goes here for the factory //... retu userObject; } The problem is, every time I call the isLoggedIn() function from my controllers, it retus a false. I tried if (this.userObject.email === ''), which retus the error TypeError: Caot read property 'token' of undefined in the console. This functionality works fine when I define userObject in a service. Is there some scope limitation that I'm missing? What am I doing wrong? as...

ادامه مطلب

how to include html template on runtime in angularjs

Vote count: 0 In my angular app some of the sections are there. And these will be added one by one on clicking. But I am bit confused that how to insert those sort of section. I know how to include the html template.but i don't want to include all the sections initially making it invisible with ng-hide or something. I want to be inserted only clicking. Thanks in advance! asked 1 min agoPartha Chowdhury Let's block ads! بخوانید...

ادامه مطلب

How to use different layout for specific views in sails.js and angular.js

Vote count: 0 I have a Sails.js + Angular.js project. I am using a single layout for this project. But right now I got different html, and it's layout is totally different from the one I am using right now. The current layout file I am using is the default one layout.ejs which located at views/layout.ejs. In the layout.ejs file, the header and footer are resuable throught the project, The body part which is , I am using angular.js for this dynamic part. And the angular app file is like: function config($routeProvider) { $routeProvider.when('/movie', { templateUrl: '/templates/movie-list.html', controller: 'MovieCtrl' }).when('/movie/:id', { templateUrl: '/templates/movie-detail.html', contro...

ادامه مطلب

TemplateAssertionError "no filter named", filter confusion mixing Angular & Flask

Vote count: 0 I am trying to use the code in the link here within Flask, but it seems that Jinja2 is trying to interpret the json filter. I have edited the code slightly by encapsulating flask variables with startSymbol [[ and endSymbol ]]. This has been done by adding the following code to my controller: app.config(function ($interpolateProvider) { $interpolateProvider.startSymbol('[['); $interpolateProvider.endSymbol(']]'); }); Furthermore, I have explored Triangle, but this introduces its own set of errors (namely, NameError: name 'unicode' is not defined) as a result of the module not working with Python3. It also seems that Triangle hasn't been supported for a while, so I'm not sure tha...

ادامه مطلب

angular js, asp.net mvc : Does $http works only with ApiController but not with normal Controller?

Vote count: 0 I am trying to develop a simple form using angular js 1.* and asp.net mvc 5. When I try to save the form data using $http(), it hits the action but none of the data is passed. But if I use $.post(), it works perfectly. Could anybody please explain me why? Is that because we need to use ApiController instead of normal mvc's Controller? Or what could be the potential problem? AddEmployeeController.js (function () { 'use strict'; angular.module('ApplicationModule').controller('AddEmployeeController', function ($scope, SPACRUDService) { $scope.Id = 0; $scope.employee = { FirstName: 'Hello', MiddleName: '', LastName: '', CurrentAddress: '', PermanentAddress: '', Gender: 'M', MobileP...

ادامه مطلب

angular ngif button on table

Vote count: 0 i am trying to make table in which there are two show/hide buttons for two columns say A and B.. button a and b separately are functioning properly but If i use both in table ... only one of them functions properly other doesn't do anything.. pls hlp me i am new to this # Useame> Profile Points Forcasts Won/Lost Invites Referrals Activity Most Used Redeemption Gateway Most Read FAQ Promo Codes used Suspend/Unsuspend {{person.id}} {{person.uname}} Hide Show {{person.points}} {{person.forcasts}} sent: {{person.invites[0].sent}} accepted: {{person.invites[0].accepted}} {{person.referrals}} Hide Show {{person.muredempt}} {{person.mfaq}} {{person.promocodes}} {{person.isSuspended}} ...

ادامه مطلب

Receive ng-init value from the controller for angular js

Vote count: 0 I put data in the ng-init then I want to receive these value for my controller. app.controller('hotelDetailCtrl', function ($scope, $http) { $scope.init = function(){ alert($scope.detailUrl); }; }); But I can't get these value from my controller.Please help me and then explain about these case. asked 1 min agoMr Myo Let's block ads! بخوانید...

ادامه مطلب