Vote count: 0 I'm using angular 1.5.2 and angular ui router 0.2.5, i make a page transition, from a state to another state, only the screen changes, but the controller not change, i tried to do the transition by three different ways: $location.path('/home'); $state.go('home'); $state.transitionTo('home'); the states appTmw.config(function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/login'); $stateProvider.state('login', { url: '/login', controller: 'LoginCtrl', views: { '': { templateUrl: '/components/login/loginview.html' } } }) .state('home', { url: '/home', controller: 'HomeCtrl', views: { '': { templateUrl: '/components/home/homeView.html' }, 'nav@home': { templa...
ادامه مطلبVote count: 0 I'm trying to send multiple parameters to the backend in an http.get call. Issue is I don't see them in express: Angular: $http.get("/getImage/", {params: {"filename" : $scope.recipe.image.filename, "mimetype" : $scope.recipe.image.mimetype}}) .then(function(retuData){ console.log(retuData); }) Express: server.get("/getImage/", function (req, res) { console.log(req.params.filename); }) req.params.filename shows up as undefined when logged. All help is appreciated. Thank you! asked 3 mins agouser5854440 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Sometimes I have utility functions that I want to use globally that don't rely on dependency injection in an angularjs app. I've wanted to throw them in a .constant(..) but I can't seem to find any documentation advocating this though I do remember someone advising against this. I was thinking something like so angular.module('myApp', []) .constant('myFunction', myFunction); function myFunction(msg) { alert(msg); } Other resources though suggest putting them into a factory or $rootScope. (example) The former feels verbose and the latter I have a distaste for. Is it acceptable in angularjs 1.x best practices to use .constant to store global functions that don't rely on dependenc...
ادامه مطلبVote count: 0 I am using Elasticsearch to store and query logs. I am creating a front end UI that will display the queried information from Elasticsearch to a webpage using AngularJs. The webpage is ruing on CentOS 6 Apache HTTPD on port 80. Elasticsearch is ruing on port 9200. When I query Elasticsearch using AngularJs I am getting the following error: XMLHttpRequest caot load http://my_ip/ali_viewer/log/_search. Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response. This seems to be a common issue found on stackoverflow and the rest of the web, but after trying so many solutions with no success I will post my specific configuration. httpd.co...
ادامه مطلبVote count: 0 I'm trying to lea to use Angular 2 while creating templates using Jade and importing the transpiled .html files. How can I include *ngIf and *ngFor in Jade? Trying to achieve the following in HTML: I'm trying the following in Jade: div.container(*ngIf='products && products.length') The above code doesn't work! Help? asked 48 secs agoSuy Bharadwaj Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am calling a $http.post function but can not grab the data on the other side, the calls goes through successfully but can not retrieve the data in my PHP script AngularJS: var data = { firstname: $scope.first_name, lastname: $scope.last_name, email : 'test@fff.com', user : userID }; var config = { headers : { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;' } } $http.post('http://xxx-env.us-east-1.elasticbeanstalk.com/apipost/updateusersetting/user/'+userID, data, config).success(function (data, status, headers, config) { alert('yay'); // this works and gets called }) .error(function (data, status, header, config) { }); Server side PHP: $data = json_decode(f...
ادامه مطلبVote count: 0 I have artists information in the angular scope and used ng-repeat to repeat to list all artist info in the template. I am trying to sort (name, title, label, view) data using list.js. Unfortunately, the sorting part doesn't seems to work. I have installed list.js using bower and mentioned the source in the html template . I am exactly trying to replicate this codepen but with angular. I am aware about angular sorting! Sort by name Sort by Project Sort by Label Change View...
ادامه مطلبVote count: 0 I created a simple plunk that demonstrates the issue. When I use angular.injector(['ng', 'MyModule']).get('MyService') I seem to get a new instance every time it is called, or at least behaves as such. In the plunk, notice how the "Increment" button calls the same instance of the service, as opposed to how the "Call Via Injector" works. I have been banging my head for hours, tried various things, and read many apparently-relevant posts but to no avail. Any help is appreciated. asked 38 secs agoamahfouz Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have a simple web form in thymeleaf(which works) and I want to convert it to Angular js. What I should do ? All website backend written on java File to upload: asked 1 min agoOleg Let's block ads! بخوانید...
ادامه مطلبVote count: 0 TLDR: I wish to add a field to the $stateProvider called "layout" that tells the ui which layout it should load before the routes html So i know that is is currently possible to make a layout variable by creating an abstract class: .state('dashboard', { abstract: true, url: '/dashboard', templateUrl: 'tpl/app.html', }) However there are sveral reason as to why i do not wish this: In my application there are two types of layouts: Client layout Which has a url of: tpl/client/client.html Admin layout Which has a url of: tpl/app.html Now in my application i have many routes and states this is because my application is divided into modules and each module has their own routes An exa...
ادامه مطلبVote count: 0 I would like to save my model, by clicking on the button SAVE, after dragging a few points, in HIGHCHARTS. This is my fiddle : http://jsfiddle.net/nicolas1000/efv0vvbp/ Unfortunatly, $scope.test doesn't show any change after Dragging a point and clicking save ! THank you if you have any idea ! code : look at fiddle asked 6 mins agonicolas jojo Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Hi I want to change the url on successful login. The login url is localhost/filename/login.html and on successful the url is localhost/filename/index.html#/birds_eye. Am using angularjs 1.3.14. Here is the app.js code var app = angular.module('cirqSignUp', ['cirq.controllers','cirq.services','ngRoute','ngStorage']) app.config(['$routeProvider', function($routeProvider) { $routeProvider .when('/login',{templateUrl: '/login.html', controller: 'login'}) .when('/birds_eye', {templateUrl: 'pages/birds_eye_view.html', controller: 'birdsEye',reloadOnSearch: false}) //.when('/analytics', {templateUrl: 'pages/analytics.html', controller: 'birdsEye'}) //.when('/items', {templateUrl: 'pag...
ادامه مطلبVote count: 0 I have tab component: BootStrap Tab Component This is the content of the first tab. This is the content of the second tab. and logic: angular.module('components', []). directive('tabs', function() { retu { restrict: 'E', transclude: true, scope: {}, controller: [ "$scope", function($scope) { var panes = $scope.panes = []; $scope.select = function(pane) { angular.forEach(panes, function(pane) { pane.selected = false; }); pane.selected = true; } this.addPane = function(pane) { if (panes.length == 0) $scope.select(pane); panes.push(pane); } }], template: '' + '' + ''+ '{{pane.title}}' + '' + '' + '' + '', replace: true }; }). directive('pane', function() { retu { require: '^tabs',...
ادامه مطلبVote count: 0 I am new to Restful and AngularJS. I have one requirement in which i have to upload any MIME file into database using RestFul and AngularJS. asked 1 min agoRahul Maurya Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have an Angular.js application, that I want to minify. First of all, I've setup a certain gulp pipeline in order to handle aotations and minifications automatically. In order to check how well implicit aotations work, I've added aotations using ngAotate and then ran application with strictDi options in order to catch all missed aotations. Then I've added comment hints for all missing aotations I've found. After that, everything works great, ngAotate automatically aotates my code and strict-di has no more waings. However, when I actually minify my code using UglifyJS2, it fails to start the application saying that some service wasn't being found. Here's the actual error messag...
ادامه مطلبVote count: 0 I created a project in MVC5 over Entity Framework and AngularJS. Now, what I want is to pass every database object to an MVC controller, in order to update their values. (ex: to modify a "customer" value) The following code doesn't work.. {{r.ID}} {{r.LastName}} {{r.FirstName}} {{r.Phone}} {{r.Email}} Please help me about how to pass r.ID to the razor above @Html.ActionLink("Edit", "Edit", new { id = r.ID }) asked 8 mins agoGeorgios Deliandreadis Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am working in Angular ui-grid Now I have a requirement where in once cell got check box and in another cell editable text box. The validation requirement should be if the check box is checked then the editable text box for that row is required field How can I do it. Add row Please look at the pluncker asked 2 mins agouser3048027 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I'm using the newest Webstorm 2016.1 und angular 2 seed. Somehow it doesn't auto import libraries from node modules any more (e.g. RouteConfig or OnInit) any suggestions? Thanks! asked 1 min agoHan Che Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have a JSPM/Typescript/Angular 1.5.3 project. I want to use the new component router. In my project dir, I used the command jspm install npm:@angular/router and it installed fine with no errors. I then added it to my app.ts file with import ngComponentRouter from 'jspm_packages/npm/@angular/router@0.2.0/angular1/angular_1_router' But when I start my lite-server, I get Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/jspm_packages/npm/@angular/instruction.json Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/jspm_packages/npm/@angular/utils.json Failed to load resource: the ...
ادامه مطلبVote count: 0 I'm a total newbie to Angular/Angular2, and maybe I'm getting into too deep water.... but I'm trying to display the result from a Web API controller using angular... So far I have: boot.ts: import {bootstrap} from 'angular2/platform/browser' import {HTTP_PROVIDERS} from 'angular2/http' import {AppComponent} from './app' bootstrap(AppComponent, [HTTP_PROVIDERS]); app.ts: import {Component} from 'angular2/core'; import {Http} from 'angular2/http'; @Component({ selector: 'my-app', template: '{{title}}' }) export class AppComponent { http: Http; public title; constructor(http: Http) { this.title = 'Loading list'; this.http = http; } } index.html: Angular 2 with ASP.NET 5 System.con...
ادامه مطلب