Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Frederik Prijck
@frederikprijck
@vanagasa No idea, it seems to work for me: https://plnkr.co/edit/0TOe5o3JvxJ8q3etdCHX?p=preview
Stepan Suvorov
@stevermeister
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
@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
it really helps!
@frederikprijck thanks a lot!
Frederik Prijck
@frederikprijck
Glad it works !
Robert Butler
@lighth7015
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

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
Sure.
Robert Butler
@lighth7015
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
That happens alot.
That often means you have different versions, or the problem is in ur app.
Robert Butler
@lighth7015
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
Are you using the same version of all libraries ?
Robert Butler
@lighth7015
Yeah, pretty sure I am
Johnathon Sullinger
@scionwest
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
Johnathon Sullinger
@scionwest
oh, whoops i see the topic now - thanks
Rhitik Bhatt
@lambainsaan
Hello!
Frederik Prijck
@frederikprijck
hey @lambainsaan
dadepo
@dadepo

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
You have to bind to the controller
var myApp = angular.module("myApp", []);
myApp.controller('MainController', function() {
    this.model = "Initial value"
})
dadepo
@dadepo
Never mind...on trying again, everything works as it should...must have overlooked something initially
Frederik Prijck
@frederikprijck
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
good evening all
is angular worth my time to learn?
Frederik Prijck
@frederikprijck
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
i bought a book today, its about 1
Frederik Prijck
@frederikprijck
Depending on your JavaScript knowledge, I'd even start learning 2.
Wim Huiskes
@wimhuiskes
i want to build an app, that stores data, and sents that data by mail to the owner of the app
Frederik Prijck
@frederikprijck
But if you're new to JavaScript aswell, you might wanna start off learning 1.
Wim Huiskes
@wimhuiskes
i am not new to javascripy
t
Frederik Prijck
@frederikprijck
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
but i think that what i want to build is more backend