These are chat archives for angular/angular.js

13th
Jan 2017
theromie
@theromie
Jan 13 2017 06:45
@theromie
after configuring node angular app still getting this error
http://localhost:3000/node_modules/core-js/client/shim.min.js
localhost/:13 GET http://localhost:3000/node_modules/zone.js/dist/zone.js
localhost/:14 GET http://localhost:3000/node_modules/reflect-metadata/Reflect.js
localhost/:15 GET http://localhost:3000/node_modules/systemjs/dist/system.src.js
localhost/:17 GET http://localhost:3000/systemjs.config.js 404 (Not Found)
(index):19 Uncaught ReferenceError: System is not defined
at (index):19
theromie
@theromie
Jan 13 2017 07:11
??
Frederik Prijck
@frederikprijck
Jan 13 2017 07:12
@theromie wrong room. This is Angular1; U want Angular2: https://gitter.im/angular/angular
vanagasa
@vanagasa
Jan 13 2017 07:39
Hi im trying to pass paramether with: <a ng-click="getCity(cityArr[0])" and use it in script with: var weatApp = angular.module('WeatApp', []); weatApp.controller('weatCtrl', function($scope, $http) { $scope.cityArr=['KAUNAS', 'VILNIUS', 'KLAIPEDA', 'SIAULIAI', 'PANEVEZYS']; $scope.getCity = function(city){ $scope.sendCity=city; return city; and it doesnt get value back to html: <span id="weather" ng-cloak>{{sendCity}}</span> what im doing wrong?
Frederik Prijck
@frederikprijck
Jan 13 2017 09:23
@vanagasa No idea, it seems to work for me: https://plnkr.co/edit/0TOe5o3JvxJ8q3etdCHX?p=preview
Stepan Suvorov
@stevermeister
Jan 13 2017 13:23
what is the best way to find broken injection during minification?
I have too many services to check them one by one
now I'm deep inside injector to put debugger there
not sure what is the best place to track it
Frederik Prijck
@frederikprijck
Jan 13 2017 13:26
@stevermeister Using strict-di in none-minification mode might help .
Tools like ng-annotate let you use implicit dependency annotations in your app and automatically add inline array annotations prior to minifying. If you decide to take this approach, you probably want to use ng-strict-di.

Long store short:

<html ng-app="myApp" ng-strict-di>
or

angular.bootstrap(document, ['myApp'], {
  strictDi: true
});
Stepan Suvorov
@stevermeister
Jan 13 2017 13:42
it really helps!
@frederikprijck thanks a lot!
Frederik Prijck
@frederikprijck
Jan 13 2017 13:43
Glad it works !
Robert Butler
@lighth7015
Jan 13 2017 17:24
OKAY, so I'm trying to create a pageable table that supports a single selection across the whole list. I'm using
($index == $ctrl.selected.index && $ctrl.page == $ctrl.selected.page)
to (attempt) figuring out if the selection was on that page, do I need to re-trip the html creation by emptying out my temporary listview every time I change pages?
Frederik Prijck
@frederikprijck
Jan 13 2017 17:28

Can you create a plunkr @lighth7015 ? Not very clear what you want to do, or atleast not what you mean with:

do I need to re-trip the html creation by emptying out my temporary listview every time I change pages?

Robert Butler
@lighth7015
Jan 13 2017 17:28
Sure.
Robert Butler
@lighth7015
Jan 13 2017 17:50
okay, that's weird.
I have a working example on Plunkr, but when I move it over to my production code, it stops working properly
Frederik Prijck
@frederikprijck
Jan 13 2017 17:51
That happens alot.
That often means you have different versions, or the problem is in ur app.
Robert Butler
@lighth7015
Jan 13 2017 17:52
yeah, it's weird though
because you think you've fixed a problem when you're on Plunkr, only for it to not work when you go plug it in, lol
Frederik Prijck
@frederikprijck
Jan 13 2017 17:53
Are you using the same version of all libraries ?
Robert Butler
@lighth7015
Jan 13 2017 17:58
Yeah, pretty sure I am
Johnathon Sullinger
@scionwest
Jan 13 2017 18:14
I setup a new ng2 project using the angular-cli, and then added routing using https://angular.io/docs/ts/latest/guide/router.html as my guide, but when ever I navigate to a route, it redirects me back to my root route
Frederik Prijck
@frederikprijck
Jan 13 2017 18:14
Johnathon Sullinger
@scionwest
Jan 13 2017 18:14
oh, whoops i see the topic now - thanks
Rhitik Bhatt
@lambainsaan
Jan 13 2017 19:46
Hello!
Frederik Prijck
@frederikprijck
Jan 13 2017 19:48
hey @lambainsaan
dadepo
@dadepo
Jan 13 2017 21:03

I just found that if I use $scope to bind value to view and I use ng-model in an input, the value set in the controller shows in the view by default...but this is not the case if I use the Controller as Syntax.

For example this works:

// Js
var myApp = angular.module("myApp", []);
myApp.controller('MainController', function($scope) {
    $scope.model = "Initial value"
})
// View
<input type="text" name="model" ng-model="model"><br/>

the input onload has the text "initial value"

Frederik Prijck
@frederikprijck
Jan 13 2017 21:03
You have to bind to the controller
var myApp = angular.module("myApp", []);
myApp.controller('MainController', function() {
    this.model = "Initial value"
})
dadepo
@dadepo
Jan 13 2017 21:05
Never mind...on trying again, everything works as it should...must have overlooked something initially
Frederik Prijck
@frederikprijck
Jan 13 2017 21:06
You dont have to bind to scope when using controller as
and use it:
<div ng-controller="MainController as main">
{{main.model}}
</div>
That's how you need to use controller as syntax @dadepo
Not using scope.
Wim Huiskes
@wimhuiskes
Jan 13 2017 21:14
good evening all
is angular worth my time to learn?
Frederik Prijck
@frederikprijck
Jan 13 2017 21:15
Hey @wimhuiskes .
Depends on what you're plans are with it, but I'd say it's worth it.
Looking for Angular 1 or 2 tho ? :) They're both awesome, but well ... ng2 is new.
Wim Huiskes
@wimhuiskes
Jan 13 2017 21:16
i bought a book today, its about 1
Frederik Prijck
@frederikprijck
Jan 13 2017 21:17
Depending on your JavaScript knowledge, I'd even start learning 2.
Wim Huiskes
@wimhuiskes
Jan 13 2017 21:17
i want to build an app, that stores data, and sents that data by mail to the owner of the app
Frederik Prijck
@frederikprijck
Jan 13 2017 21:17
But if you're new to JavaScript aswell, you might wanna start off learning 1.
Wim Huiskes
@wimhuiskes
Jan 13 2017 21:18
i am not new to javascripy
t
Frederik Prijck
@frederikprijck
Jan 13 2017 21:18
It's not about being new, it's about whether or not you're familiar with modern JavaScript using ES6, Module bundlers etc.
Wim Huiskes
@wimhuiskes
Jan 13 2017 21:18
but i think that what i want to build is more backend
i am not familiar with FS6
Frederik Prijck
@frederikprijck
Jan 13 2017 21:19
So start with Angular1. :D
Wim Huiskes
@wimhuiskes
Jan 13 2017 21:20
but is it possible to build the app i want?
should be easy………..i think (:
Frederik Prijck
@frederikprijck
Jan 13 2017 21:20
Angular isn't going to help you store the data and mail the owner.
Wim Huiskes
@wimhuiskes
Jan 13 2017 21:21
that would be php
Frederik Prijck
@frederikprijck
Jan 13 2017 21:21
Angular is only html/css and JS.
Wim Huiskes
@wimhuiskes
Jan 13 2017 21:22
is there any online resource where i can start?
Wim Huiskes
@wimhuiskes
Jan 13 2017 21:22
@frederikprijck thanks :smile:
Frederik Prijck
@frederikprijck
Jan 13 2017 21:22
Goodluck @wimhuiskes !
Wim Huiskes
@wimhuiskes
Jan 13 2017 21:24
thanks and nice to meet :smile:
i am from holland, so we are neighbours
Frederik Prijck
@frederikprijck
Jan 13 2017 21:28
Yep, I know :D