These are chat archives for angular/angular.js

10th
Jan 2017
Frederik Prijck
@frederikprijck
Jan 10 2017 07:20
@tarnos12 What exactly are you calling twice ? Are you create a new interval twice, or is the code inside the interval running twice ?
Alex
@sashberd
Jan 10 2017 07:42
Hey guys, Is there is any good solution to make resolves in directives. Here the solutions are ambiguous angular/angular.js#2095
am0nshi
@am0nshi
Jan 10 2017 08:10
good morning guys. if I have cyclic dependency between two services - the best way to separate shared functionality into 3rd service?
allen0714
@allen0714
Jan 10 2017 08:13
Hi guys , I have a question of ui-router. Can I back to the previous state without reloading controllers? which means I can preserve the previous state params.. somebody help..
am0nshi
@am0nshi
Jan 10 2017 08:33
@allen0714 save state in localstorage?
allen0714
@allen0714
Jan 10 2017 08:40
@am0nshi It works but I dont’t think it’s a good idea.
Alex
@atodicebear
Jan 10 2017 09:24

How can I filter deeper nested Objects with Angular in the ng-repeat?

<tr ng-repeat="v in $ctrl.htmlV | filter: {titel : search } ">
          <td >{{v.dict_Langs[1].HtmlLang.titel}}</td>

same level would be the Example above.
One level deeper it should be
filter : {dict_Langs: {titel:search } } //if im not mistaken
One level deeper
filter : {dict_Langs[1]: { HtmlLang: {titel:search } } } // not working
Can someone help with that?

Rob
@borriej
Jan 10 2017 09:29

Encoding issue.. with a custom direct

<button ... confirm-click-message="special string with ë ä characters"

results in the <?> in the directive controller

why?
it's BS to not be able to use UTF8 characters in the string?
Rob
@borriej
Jan 10 2017 10:21
solved
template enconding saving ussie
ANSI vs UTF8
Alex
@atodicebear
Jan 10 2017 11:12

Can I somehow set ng-model to one-way-binding?
I have a readonly Textfield and one to make Updates.
If I update something in the Second Textarea the first one is as well updated cause of Angular Binding but I want to shut it off in the Readonly Textarea..
Possible?

<input type="text" class="form-control" placeholder="//Html Values Titel" ng-model="::{v.dict_Langs[0].HtmlLang.titel}" ng-readonly='true'></input>

This is not working :/

George Kalpakas
@gkalpak
Jan 10 2017 11:15
@atodicebear: I sounds more like you need two different values/models (that initially have the same value).
Alex
@atodicebear
Jan 10 2017 11:17
@gkalpak Yeah thought about that workaround :) But asked for Future Knowledge if something like this is possible. With so much that Angular gives maybe we can take it somehow away :D
George Kalpakas
@gkalpak
Jan 10 2017 11:21
It is not a workaround. It is your requirement. ngModel is for binding a model to an input (and keep them in sync). readonly means "do not let the user interact with this input" (and as a consequence modify the bound model). What you want is something different: You don't want changes to the model to propagate to the input. That is not what ngModel is about. Maybe ngValue is more suitable for your usecase, but in any case these directives are for keeping model/view in sync (which is not what you want).
If you know that your value won't be undefined, you can probably use ngValue/value with one-time binding:
<input ... ng-value="::someModel" />
Alex
@atodicebear
Jan 10 2017 11:37

@gkalpak
It is possible that it will be sometimes undefined :/

        <tr ng-repeat="v in $ctrl.htmlV">
          <td >
            <input type="text" class="form-control" placeholder="//Html Values Titel" ng-value="::v.dict_Langs[0].HtmlLang.titel" ng-readonly='true'></input>
            <textarea ui-tinymce='tinymceOptionsRead' ng-model='v.dict_Langs[0].HtmlLang.text' ></textarea>
          </td>

ng-value works only if its defined, crap...
But for the Case with ui-tinymce I need the ng-model.
If I do a Copy of the Repeated Collection and set the Copy in the TinyMce It wont be updated but I would need a Second ng-repeat, would I?
And somehow a Function which binds the Copy to the Original Values in Cases for Filters,Sorting and more so they are always placed together?

George Kalpakas
@gkalpak
Jan 10 2017 12:17
If you just want to keep the original value in the input, how about something like:
<tr ng-repeat="v in $ctrl.htmlV" ng-init="originalTitel = v.dict_Langs[0].HtmlLang.text">
  <td >
    <input ... ng-value="::originalTitel" ng-readonly='true'></input>
    <textarea ... ng-model='v.dict_Langs[0].HtmlLang.text' ></textarea>
  </td>
</tr>
Although, I don't see why you have an issue here, since your ngModel were bound to different properties (i.e. titel vs text).
vanagasa
@vanagasa
Jan 10 2017 12:27
Hey im trying to use directive in my function, but it doesnt work while it is in function whys that?function getCity(city){
document.getElementById("weather").innerHTML=city;
function (data) {
}
temp();
}
function temp(){
var app = angular.module("weatApp", []);
app.directive("humiGet", function() {
return {
template : "TEST"
};
});
}
Alex
@atodicebear
Jan 10 2017 12:30

For maybe more Detailed Explanation

  <tr dir-paginate="v in visibleItems = ($ctrl.htmlV | filter: {titel: searchK} | filter:select) |orderBy: sortType:sortReverse|itemsPerPage:10 as results" ng-init="originalTitel=v.dict_Langs[0].HtmlLang.titel;originalText =v.dict_Langs[0].HtmlLang.text">
          <td class="td-values1">
            <input type="text" class="form-control" placeholder="//Html Values Titel" ng-value="::originalTitel" ng-readonly='true'></input>
            <textarea ui-tinymce='tinymceOptionsRead' ng-model='::originalText' ></textarea>
          </td>
          <td class="td-values1">
            <span ng-if="select1==select2">
            <input type="text" class="form-control" placeholder="//Html Values Titel" ng-model="v.dict_Langs[0].HtmlLang.titel"></input>
            <textarea ui-tinymce='tinymceOptions' ng-model='v.dict_Langs[0].HtmlLang.text' data-section='{{v._id}}' data-section2='{{v.dict_Langs[0].HtmlLang.titel}}'></textarea>
            </span>
            <span ng-if="select1!=select2">
            <input type="text" class="form-control" placeholder="//Html Values Titel" ng-model="v.dict_Langs[1].HtmlLang.titel"></input>
            <textarea ui-tinymce='tinymceOptions' ng-model='v.dict_Langs[1].HtmlLang.text' data-section='{{v._id}}' data-section2='{{v.dict_Langs[1].HtmlLang.titel}}'></textarea>
            </span>
          </td>

I create 2 TinyMce in the same Row. First one Readonly to see the Orignal Value und be able to Copy Paste it in the Second.
After Changes in the Second TinyMce the Changes as well Happend to the first one cause of Bind.
Thats why I wanted an OneWay Binding so it stays with the Originally Value :)
So I needed something for Titel and Text.
At the moment your Solution with ng-init seems to work , thank you :)

am0nshi
@am0nshi
Jan 10 2017 16:15
guys, how properly called functionality when browser physically change url, but didn't reload page data?
Daniel Neves
@ghuroo
Jan 10 2017 17:33
@am0nshi are you using a router for the url change?
Sean Murphy
@SeanFullstack
Jan 10 2017 17:39

Good Afternoon,

​I hope I find you well and sorry to bother you on a proffesional forum like this.

​I am currently recruiting for a FullStack JavaScript Developer based in the heart of London on a permanent basis.

The successful JavaScript developer will help rebuild the clients current legacy ecommerce platform and internal applications. This exciting position will involve using the latest JavaScript technology such as ES6, Node, Angular (with Angular2 in mind), Typescript etc.

​As well as building a cutting-edge ecommerce platform, you will also help build a custom Node API and various dashboards to help the business perform more efficiently. While you will be vital to the development side, you will also contribute to planning the architecture and brain storming with a small but highly skilled team.

This is the perfect position if you are extremely passionate about JavaScript and have a desire to work with other like-minded developers.

​If this is of interest and would like to hear more please get incontact urgently for immediate consideration.​

Frederik Prijck
@frederikprijck
Jan 10 2017 17:41
@SeanFullstack No remote I guess ?
Sean Murphy
@SeanFullstack
Jan 10 2017 17:42
This message was deleted
Benedikt Berger
@bergben
Jan 10 2017 17:59
Hey guys! I am trying to integrate angularJS and npm with .NET MVC 5. Does anyone know a good blog post or something on that? I got npm, I got angular, but I still have to add webpack. I'd like that the back-end developers don't have to install node, npm and webpack though. How do I do that?
I am gonna check in node_modules, that's fine. I just need webpack I guess?
Frederik Prijck
@frederikprijck
Jan 10 2017 17:59
@bergben why integrating it with .NET MVC ?
Benedikt Berger
@bergben
Jan 10 2017 18:00
@frederikprijck
Frederik Prijck
@frederikprijck
Jan 10 2017 18:00
Why not use Web APi and seperate the backend and frontend development.
Benedikt Berger
@bergben
Jan 10 2017 18:00
only used Meteor so far, which does all of that stuff for me automatically.
Because that's what the Backend guys use
I wish I could @frederikprijck
Frederik Prijck
@frederikprijck
Jan 10 2017 18:00
You'll still require them to install all those things.
If you don't seperate the backend and frontend dev
Benedikt Berger
@bergben
Jan 10 2017 18:01
The only problem I see is webpack
i can check in node_modules so they don't need no node and npm
Frederik Prijck
@frederikprijck
Jan 10 2017 18:01
Well, checking in node_modules is a big no no.
They still need node and npm tho.
Benedikt Berger
@bergben
Jan 10 2017 18:02
I know it's a big no no, but it's the only no no
Frederik Prijck
@frederikprijck
Jan 10 2017 18:02
Well you're VCS isn't going to like that.
Benedikt Berger
@bergben
Jan 10 2017 18:03
I already did this with Angular 2 and .NET MVC and it works fine without them having node and npm. But I'd rather use webpack over system.js
Frederik Prijck
@frederikprijck
Jan 10 2017 18:03
webpack will be inside node_modules, so checking in node_modules "solves" ur problem with webpack
Benedikt Berger
@bergben
Jan 10 2017 18:03
oh ok
Frederik Prijck
@frederikprijck
Jan 10 2017 18:04
But I'm unsure how they are using your node_modules without node or npm.
Benedikt Berger
@bergben
Jan 10 2017 18:04
so I add webpack as a devDependency and create the webpack.config and that should do?
I know it's not clean.
Frederik Prijck
@frederikprijck
Jan 10 2017 18:04
The backend guys will have to boot up the app, right ?
Benedikt Berger
@bergben
Jan 10 2017 18:05
npm does nothing else than installing all those packages into node_modules right? If I check in that whole folder, then node_modules is already there
Frederik Prijck
@frederikprijck
Jan 10 2017 18:05
not rly.
npm does more then installing packages.
Wel, it can do more*
But you're using webpack to load ur modules and bundle your code ?
Benedikt Berger
@bergben
Jan 10 2017 18:05
like run tasks and stuff you mean? well they don't need that
Frederik Prijck
@frederikprijck
Jan 10 2017 18:05
how's the backend team gonna bundle and load those things without node ?
Benedikt Berger
@bergben
Jan 10 2017 18:06
:D
They don't
Frederik Prijck
@frederikprijck
Jan 10 2017 18:06
So how will they boot up the website ?
Benedikt Berger
@bergben
Jan 10 2017 18:06
ahhh
wait
Frederik Prijck
@frederikprijck
Jan 10 2017 18:08
not sure why you are trying to combine mvc and angular tho.
using web api is going to give you alot more benefits (and that's the way to go imo anyway).
Benedikt Berger
@bergben
Jan 10 2017 18:09
I know it would, I am not liking it either, but I am not in charge to decide about that :( Give me a moment, need to check on something about angular 1.x
Have only been using angular 2 since like one year :sparkles:
Frederik Prijck
@frederikprijck
Jan 10 2017 18:10
Atleast I hope it's a legacy project and not a new one, coz setting up a new project that way realy makes no sense.
Benedikt Berger
@bergben
Jan 10 2017 18:10
how would you set it up?
I mean, given that you can't change .NET MVC 5
Frederik Prijck
@frederikprijck
Jan 10 2017 18:10
web api.
Web Api looks, works and is being developed 100% the same as MVC.
with the only difference that it has no view part.
But when using angular, u need no view part
as ur using angular.
Benedikt Berger
@bergben
Jan 10 2017 18:11
It's a big app, we are only using angular in parts of it
Frederik Prijck
@frederikprijck
Jan 10 2017 18:11
What I'd do is:
Set up a web api inside/next to the mvc project and create ur frontend dev seperatly.
This requires almost no change to the backend guys development process.
and that's gonna give u 100x more possibilities on the frontend.
Benedikt Berger
@bergben
Jan 10 2017 18:13
We are not even having a whole angular view, it's just that I want to handle the dynamic parts of it with angular as jQuery makes me puke by now
Frederik Prijck
@frederikprijck
Jan 10 2017 18:16
Nothing wrong with jQuery for doing simple ajax calls and updating some content.
Benedikt Berger
@bergben
Jan 10 2017 18:16
I understand what you are trying to say here @frederikprijck , it's not like I disagree with you. I just can't convince the backend guys about this right now, so I need to deal with this - one way or the other.
Frederik Prijck
@frederikprijck
Jan 10 2017 18:17
Well I'm a backend .NET guy. Just sad to hear. :) Web API is THE (.NET) way to go to integrate with frontend technologies such as angular.
But asking the question again: How is ur backend team gonna boot up the app, written in angular using webpack, without being able to run node ? (or are you going to check in the bundled sources aswell?)
If you're not allowed to seperate frontend and backend dev, they should just install node. Seperating the frontend and backend process is alot less effort compared to what you're trying to set up.
Benedikt Berger
@bergben
Jan 10 2017 18:23
I guess I am gonna drop npm and just use the angular 1 nuget packages
This is way too messy
Frederik Prijck
@frederikprijck
Jan 10 2017 18:24
Atleast go for the bower package.
Even tho I don't like bower, I do think it's a better idea then nuget.
Benedikt Berger
@bergben
Jan 10 2017 18:25
I'll add that if needed, yes
does all of this integrate better with asp.net core though?
Frederik Prijck
@frederikprijck
Jan 10 2017 18:26
Use a package manager for what it's needed.
nuget is not for frontend .
Benedikt Berger
@bergben
Jan 10 2017 18:26
you know anything about that?
Frederik Prijck
@frederikprijck
Jan 10 2017 18:26
It will never integrate smoothly, unless u set up REST services.
Doesn't matter if it's MVC 5, DOT NET CORE, PHP, Ruby, Java ...
You are combining two technologies to do the same: create html pages.
The one is a server side technology, the other a client side.
Benedikt Berger
@bergben
Jan 10 2017 18:27
Bower still needs node.js though right?
Frederik Prijck
@frederikprijck
Jan 10 2017 18:28
Right.
But if you need a package manager for frontend stuff, don't use one for backend stuff.
Visual Studio has great Bower and npm support for a reason tho.
Benedikt Berger
@bergben
Jan 10 2017 18:29
that's why I wanted to use npm
node.js is even available as nuget package
so I could just add that
and all would be good
Mariusz Klimek
@tarnos12
Jan 10 2017 20:09
@frederikprijck I am calling interval twice, and saving in same variable, but I simply fixed it by removing the ability to call it twice. I was just curious about how it works.
Frederik Prijck
@frederikprijck
Jan 10 2017 20:10
@tarnos12 Maybe you need timeout, but interval is something u use to execute some code continiously after n mili seconds.
timeout is executing code once, after n miliseconds.
Mariusz Klimek
@tarnos12
Jan 10 2017 20:11
@frederikprijck I know, I was just curious about whats happening behind the scenes. When I call $scope.timer = $interval(fn, 1000). 2 times I expect it to overwrite the previous interval, but it doesnt
Frederik Prijck
@frederikprijck
Jan 10 2017 20:11
So you should not call interval twice and store it in the same variable without clearing the first interval.
It does not.
Mariusz Klimek
@tarnos12
Jan 10 2017 20:12
I know how to cancel the interval
Frederik Prijck
@frederikprijck
Jan 10 2017 20:12
You need to clear the interval.
Mariusz Klimek
@tarnos12
Jan 10 2017 20:12
but it will not remove it
Is there a way to remove it? Even when I do $scope.timer = null
interval is still working
Frederik Prijck
@frederikprijck
Jan 10 2017 20:12
What do you mean ?
Mariusz Klimek
@tarnos12
Jan 10 2017 20:12
$scope.timer = $interval(fn, 1000)
$scope.timer = null
it wont clear it
Frederik Prijck
@frederikprijck
Jan 10 2017 20:13
I know how to cancel the interval
Mariusz Klimek
@tarnos12
Jan 10 2017 20:13
I know, that I have to cancel it with angular method
but I also want to remove it completely
so I can overwrite it with new values
Frederik Prijck
@frederikprijck
Jan 10 2017 20:13
cancel it and remove it .
Mariusz Klimek
@tarnos12
Jan 10 2017 20:13
how to remove?
Frederik Prijck
@frederikprijck
Jan 10 2017 20:13
Well what do you mean by removing ? :)
Mariusz Klimek
@tarnos12
Jan 10 2017 20:13
There is .on('destroy') event
by removing I mean, it does not exist anymore anywhere :D
Frederik Prijck
@frederikprijck
Jan 10 2017 20:14
You destroy an interval by cancelling it...
Mariusz Klimek
@tarnos12
Jan 10 2017 20:14
but when I do that
$scope.timer in console
still returns an object
it simply has a parameter "canceled"
Frederik Prijck
@frederikprijck
Jan 10 2017 20:15
Yes.
Mariusz Klimek
@tarnos12
Jan 10 2017 20:15
ok so I can overwrite it then?
Frederik Prijck
@frederikprijck
Jan 10 2017 20:15
If you want, sure.
Not sure what you're trying to do tho.
Mariusz Klimek
@tarnos12
Jan 10 2017 20:15
I want an ability to use $scope.time as a second argument, so my interval will happen at different time events
Do I have to cancel interval to do that?
$scope.timer = 500;
$scope.interval = $interval(fn, $scope.timer);
$scope.timer = 1000
will interval run at 1s? or keep 500ms
Frederik Prijck
@frederikprijck
Jan 10 2017 20:17
Easy to test, but I'd say it keeps 500.
Mariusz Klimek
@tarnos12
Jan 10 2017 20:17
Yeah I will test it soon, just wanted to ask if you know
so I need to cancel it everytime :|
Frederik Prijck
@frederikprijck
Jan 10 2017 20:17
Use setTimeout.
Mariusz Klimek
@tarnos12
Jan 10 2017 20:17
yeah
Mariusz Klimek
@tarnos12
Jan 10 2017 20:18
I just found that
Frederik Prijck
@frederikprijck
Jan 10 2017 20:18
:)
Mariusz Klimek
@tarnos12
Jan 10 2017 20:18
That will work :) Thanks
$timeout(fn, 1000) vs $timeout(fn(), 1000)
both will work the same, but second will also call the function when we create timeout right?
stefdelec
@stefdelec
Jan 10 2017 20:21
Hi, quick question : why would I use a cms like wordpress with angular2? like in this example http://doppiaeast.com/article/angular-2-wordpress-theme-setup/
or angularJS...
Frederik Prijck
@frederikprijck
Jan 10 2017 20:27
@tarnos12 I don't think it works that way.
@stefdelec I guess you do that when you have the need/requirement for it .
stefdelec
@stefdelec
Jan 10 2017 20:33
thanks you ;-)
It is working. I tried.
It is working perfectly
but i was wondering example of needs
Frederik Prijck
@frederikprijck
Jan 10 2017 20:38
@stefdelec When you need to use a CMS and you want/need to use angular, u combine both.
I dont see any specific reason why you would use wordpress, leave along why you would combine wordpress with angular.
@stefdelec I wasn't talking to you when I said I don't think it works that way
stefdelec
@stefdelec
Jan 10 2017 20:41
You are not really helping me understanding. Let met rephrase it :What are the pros and cons using angular with wordpress vs php templating?
Frederik Prijck
@frederikprijck
Jan 10 2017 20:42
I'm not familiar with wordpress.
Are you wondering what the pros and cons are of using a SPA approach instead of server side technologies and postbacks resulting in MPA ?
Frederik Prijck
@frederikprijck
Jan 10 2017 20:54
Generally an SPA results in a better user experience because there are no postbacks/page reloads (well not in normal navigation, we can still force page reloads etc)
stefdelec
@stefdelec
Jan 10 2017 20:54
ok.
Frederik Prijck
@frederikprijck
Jan 10 2017 20:55
But there are alot of other differences @stefdelec
stefdelec
@stefdelec
Jan 10 2017 20:55
But I was wondering, why not building the CMS in Angular2.
Not the CMS but the dashboard
Frederik Prijck
@frederikprijck
Jan 10 2017 20:55
What dashboard ?
stefdelec
@stefdelec
Jan 10 2017 20:56
In a cms there is a dashboard . You can create new post, new page.... manage your content.
I was thinking to use the CDA of the CMS and build the CMA in Angular2.$
Frederik Prijck
@frederikprijck
Jan 10 2017 20:58
What's a CDA and CMA ?
stefdelec
@stefdelec
Jan 10 2017 20:58
I gave you a wikipedia link.
It is in the first paragraph
Benedikt Berger
@bergben
Jan 10 2017 20:59
@stefdelec angular 2 simply isn't around long enough yet to have a solid CMS like Wordpress, still I wouldn't combine Wordpress with Angular
Frederik Prijck
@frederikprijck
Jan 10 2017 20:59
@bergben Their aint no cms written in Angular 1 neither, yet that's around longer.
@stefdelec I have no time to read that wikipedia , I guess if you don't bother explaining I can't help u .
But anyway, we're no CMS specialists, so ... :)
stefdelec
@stefdelec
Jan 10 2017 21:00
@bergben Thanks, for this a lot more clearer answer. Why wouldn't you notwithstanding it hasn't been around for long. (it is for a small/medium project)
Benedikt Berger
@bergben
Jan 10 2017 21:00
wasn't possible in angular 1, as it didn't cover backend
angular 2
but it's still a release candidate
Frederik Prijck
@frederikprijck
Jan 10 2017 21:00
@bergben What do you mean, it didn't cover backend ?
Angular 2 covers backend ?
stefdelec
@stefdelec
Jan 10 2017 21:01
@bergben Thanks. Very interesting tool.
@frederikprijck IMHO I think you don't know at all what you are talking about. You don't bring any point in the conversation.
Frederik Prijck
@frederikprijck
Jan 10 2017 21:01
Lol ok @stefdelec :D
stefdelec
@stefdelec
Jan 10 2017 21:02
:-)
Frederik Prijck
@frederikprijck
Jan 10 2017 21:02
Angular2 doesnt cover backend development.
stefdelec
@stefdelec
Jan 10 2017 21:02
Have you used Repond?
Benedikt Berger
@bergben
Jan 10 2017 21:02
angular 2 is isomorphic so I guess it makes it more interesting to develop a CMS using it
Frederik Prijck
@frederikprijck
Jan 10 2017 21:02
@stefdelec Well, next time when u have an angular 2 or wordpress question, don't ask the question in a room that's about angular 1 (with is not about any of ur questions)
I' trying to help u with things irrelevant to this room (hence why I am not in the wordpress room).
Benedikt Berger
@bergben
Jan 10 2017 21:03
pretty sure there is gonna be one using the MEAN stack or something
stefdelec
@stefdelec
Jan 10 2017 21:03
Thanks @frederikprijck
Frederik Prijck
@frederikprijck
Jan 10 2017 21:03
@bergben Yet it should be possible using angular 1 as it would be using Angular 2.
All you need is a Rest approach.
Benedikt Berger
@bergben
Jan 10 2017 21:04
True that
stefdelec
@stefdelec
Jan 10 2017 21:04
@frederikprijck @bergben I got my answer. Thanks to both of you.
Benedikt Berger
@bergben
Jan 10 2017 21:10
I think the most important part of a CMS is in the backend as you suggest, therefore not very much
Frederik Prijck
@frederikprijck
Jan 10 2017 21:11
@bergben I do get that isomorphic frameworks allows you to easily share code between backend and frontend.
But I don't think responscms (e.g.) is built that way, right ?
Benedikt Berger
@bergben
Jan 10 2017 21:15

yea I think just the general idea behind angular 2 and angular1 is different. Like angular 1 came to replace jquery, angular 2 now has server side rendering and stuff, you can use the interfaces etc. it just makes the whole thing a bit more interesting I think to create a whole CMS with it

RespondCMS seems to use LumenPHP

Frederik Prijck
@frederikprijck
Jan 10 2017 21:18
Ye, for REST I guess.
you can use the interfaces etc
You mean TypeScript interfaces ?
Benedikt Berger
@bergben
Jan 10 2017 21:19
:+1:
Frederik Prijck
@frederikprijck
Jan 10 2017 21:20
That's possible with Angular1 aswell.
Benedikt Berger
@bergben
Jan 10 2017 21:21
Jesus christ all I am saying is Angular has advanced, JavaScript has advanced, it is more interesting to create a CMS with it now, than it was few years ago :smile:
Frederik Prijck
@frederikprijck
Jan 10 2017 21:22
I'm simply quoting what you're saying. Angular 2 has quiet alot features which make it superior to angular 1, that's obvious. I' m not denying that. But the guys over at Angular 1 are doing an awesome job making Angular 1 look more like Angular 2 (but obviously it will stay very different )
Frederik Prijck
@frederikprijck
Jan 10 2017 21:29
And @bergben afaik server side rendering is possible aswell: https://github.com/ng-consult/ng1-server (not built in, hence not as nice).
Benedikt Berger
@bergben
Jan 10 2017 21:29
agreed :+1:
Frederik Prijck
@frederikprijck
Jan 10 2017 21:30
And don't get me wrong @bergben I fully agree with you that ng2 is more interesting for creating a CMS than ng1. But that's simply because I prefer angular 2 over angular 1, it has nothing to do with the CMS part itself.
Benedikt Berger
@bergben
Jan 10 2017 21:30
nice tool
yea angular 1 may be able to do a lot things now too, but as you suggest it just can't integrate all of those things that nicely together as ng2
Roy Mor
@Kashio
Jan 10 2017 22:48
Hi, I wish to make a tabs directive and injecting to it tab directives. I'm trying to hide all tab(s) content inside of it besides the selected tab. I'm trying to do it in the link function of the tabs directive, but it doesn't seem to work. I also feel there's a better approach to this. Here's my tabs directive:
(function () {
  'use strict';

  angular
    .module('app.widgets')
    .directive('tabs', tabs);

  tabs.$inject = [];

  function tabs() {
    return {
      link: link,
      restrict: 'E',
      scope: {},
      transclude: true,
      templateUrl: '/src/app/widgets/tabs/tabs.tpl.html'
    };

    function link(scope, element, attrs, ctrl, transclude) {
      scope.selectedTabIndex = 0;

      var tabs = [];

      transclude(scope, function(clone) {
        tabs = clone.filter(function(index) {
          return this.nodeName === 'TAB';
        });
      });

      tabs.each(function(index) {
        if (index !== scope.selectedTabIndex) {
          $(this).children().each(function() {
            $(this).css('display', 'none');
          });
        }
      })
    }
  }
})();