Does Breeze require jQuery when used with AngularJS? - angularjs

I am confused about using Breeze. I have looked through the documentation but did not see an answer for this.
When I use Breeze with ASP MVC4 and AngularJS, is it necessary for me to have the jQuery script loaded also?

[Updated Answer 10/15/2013]
(Fixed the date)
As of Breeze 1.4.4, we now support an angular ajax adapter that uses $http. See the 1.4.4 release notes for more details. So JQuery is no longer a requirement.
Breeze uses JQuery to provide its default ajax support, independent of Angular. This is provided by the breeze.jquery.ajax adapter and is pluggable. This means that you can either use JQuery or provide an alternative ajax adapter. Breeze's Angular support will work with either.
Out of the box, though, JQuery is necessary.
We will very likely provide an alternative ajax adapter that uses Angular's ajax implementation at some point in the next few months. Note that no code will need to change when this occurs, other than configuring breeze to use an alternate adapter.

As described in Customizing AJAX, you can configure Breeze to use Angular's $http service instead of jQuery like this:
breeze.config.initializeAdapterInstance('ajax', 'angular').setHttp($http);

No. Just do this:
breeze.config.initializeAdapterInstance("ajax", "angular");

Related

Migrating Angular JS 1.6.10 to 1.7.8

I need to migrate my AngularJS version from 1.6.10 to 1.7.8. I would like to know will there be any code breakage after migration?
If anyone could provide the list of differences between 1.6.x and 1.7.x would be much more helpful.
Migrating from (AngularJS) 1.6 to 1.7 contains the information you're looking for. The most notable changes are:
$resource has now support for request and requestError interceptors
Several deprecated features have been removed:
the $controllerProvider.allowGlobals() flag
the $compileProvider.preAssignBindingsEnabled() flag
the angular.lowercase and angular.uppercase methods
the $cookieStore service from the ngCookies module
the ngClick override directive and corresponding services from the ngTouch module
the complete ngScenario module
In the linked resource there is also the full list of breaking changes.
The link for the specific version 1.7.8 is: https://code.angularjs.org/1.7.8/docs/guide/migration

How I can use graphql with angular 1.5?

I have standart factories in my angular app for rest api. I need to configure my angular app for api with GraphQl. How i can do this? I now about
angular2-apollo but I have angular 1.5.
You can use angular1-apollo package.
http://github.com/apollostack/angular1-apollo
Yes you can use Apollo-Client and just wrap the functions with $q.
Here is an example (Look at the Angular1App folder): https://github.com/robzhu/graphql-demo
Here is a live example. Basically the biggest part is how to set up the client in the config, from there you can just use it like any other service.
https://codesandbox.io/s/l4r87nqj5z
Edit: this actually uses the library in Kamil's answer.

When to use angular template and when symfony template

I'm newbie web developer and I wonder what better and if it is a good question at all
I can retrieve the information that I need from the server side and make the template with angular, and I can do it with symfony too. whats better? whats the difference? when to use what?
what about forms? should I do it with symfony features or just with angular?
Please look the following points
You should use Angularjs template system. otherwise, the powerful feature of Directives.
Angularjs is decoupled with serverside code.
Angularjs only expects data (as JSON) from service end..not any HTML.
So template should be angularjs way.
So every service response from symfony should be JSON.
Angularjs totally avoiding to add HTML containers (through ajax) into web
pages. So here you can not use symfony template.

AngularJS Provider dependency injection - using $http in provider?

tl;dr
I'm really struggling to find the appropriate pattern here. How should I best configure a generalized provider to a specific use-case? I can't use $http as a dependency in .configure(); can I?
longer, boring explanation:
I am trying to create a generalized provider which I may reuse in Angular. I have it working, however it requires configuration.
The intention is to provide a fallback REST service to use in saving data to the server, but with provision to save offline in local-storage. Therefore, I need to provide appropriate $http calls for each instance of this provider.
Is it possible to provide appropriate $http calls with .configure() or else should I try and figure out how to inject $http into the provider from the start and then configure it afterward??
It's frustrating... and may change in AngularJS 2.0... But for now, yes, it is not possible to do this. There is a very high wall between the .configure() and .run() states, so you can't access $http from a .configure() function. The reason is that it hasn't actually been created. At this stage, all that exists is the provider. Once all of the dependencies are configured, then the http provider will be used to make the real $http service.
I'm not sure exactly what you're trying to do, but there are two excellent AngularJS developers that are good to follow who have some advanced patterns in projects they've shared: Pascal Precht and Brian Ford. Here are two projects that make heavy use of provider/service concepts as well as $http-driven services:
https://github.com/angular-translate/angular-translate
https://github.com/btford/angular-modal
Angular Modal, especially, does $http work to load its templates. There might be use cases in there that are similar to what you're trying to do.

Using AngularJS with SocketStream

I'd like to use socketstream's RPC over websockets abstraction while using Angular for MVC. Can anyone (probably in the Angular community) point me in the right direction to learn how to use a custom RPC-type data source to update Angular's models in the most idiomatic way?
If you want to simply sync a model with the server, here's a good example to start with that Misko Hevery made for socket.io: https://github.com/mhevery/angular-node-socketio

Resources