why Angular JS is named Angular JS? - angularjs

Please don't insult if I ask that in the bad website or bad section with the bad tags but I would like to know .
why the javascript framework angularJS has been named angularJS?

Just googled: "why is angular js called angular".
Result: https://docs.angularjs.org/misc/faq
Because HTML has Angular brackets and "ng" sounds like "Angular".

Because Angular JS can be written inside the angle brackets of HTML that is why it is known as Angular JS .
The use of 'ng' commonly in all its directives is to make the browser understand that this html page is making use of aNGular JS(Note the capital Letters)

Because html has angular brackets and ng rhymes with angular, ng = next generation, as in angular is the next generation of html

Related

How to use a directive as an entry point when using angular's bootstrap function?

I have an angular 1 app that's being bootstrapped onto a Java web page (legacy app) using ng-app tags. I'm trying to create a hybrid app using Angular 2's downgrade capabilities.
In order to do this I need to remove ng-app tags and use the UpgradeModule from #angular/upgrade/static and bootstrap using the upgrade.bootstrap(document.body, ['myapp']). However, most of the components of the app, including the entry point of the app, are just plain old angular 1.2 directives.
From the examples I've seen, they are using the controller="MenuCtrl" syntax to add components to the page. Is it possible to use directives as the entry point to the app? e.g.
<div my-menu-directive></div>
Currently, nothing is showing up in the app since I've removed the ng-app tags, but the app is definitely being bootstrapped. I'm just not seeing any of the directives.
Fixed this by wrapping the bootstrap statement in angular.element() like so:
angular.element(function() {
upgrade.bootstrap(document.body, ['myApp'], { strictDi: true });
});

Angular Meteor - Blaze is not defined

I want to use blaze from my angular controller, similar use as
https://github.com/dotansimha/accounts-ui-angular/blob/master/login-buttons-directive.js
Blaze.render(Template.loginButtons, element[0]);
When I try that from my own directive I get - "ReferenceError: Blaze is not defined".
My angular app decleration includes angular-meteor and I also tried to call angular-blaze-template but it's still not being recognized.
I'm not sure why it's working on accounts-ui-angular directive and not on mine

Angular - Is a script allowed inside a ng-view?

Maybe a trivial question here (new to Angular) - however can't seem to find any definitive answer.
Am trying a simple script within it and it doesn't seem to work, is a <script> within the ng-view html allowed?
So in my index.html i have the usual:
<ng-view></ng-view>
And in my ng-view (set by /when) - the page shows "Here is my ng-view content" so i know the ng-view works. Just the script isn't working.
<script>
alert('its working')
</script>
Here is my ng-view content
Thanks.
No <script> tags are not read in the view because that's the way jqLite in angular works. If you want scripts in templates to be evaluated, include jQuery before AngularJS. If jQuery is included, the script will be evaluated. Try removing jQuery, and you see the originally observed behavior.
Working Plunker
You will see that if you comment the jQuery script the alert won't work.
Angular jQlite Docs
You can also include the custom JavaScript files in the index page.

How to use AngularJs with Laravel 5.2 as laravel blading template and angular directive have same tags {{}}

I have read many blogs relating to this and have tried for almost a week but unable to use the both together.
Also let me tell you I have also tried using angular Js with #{{}} and also by changing the tags of angular through interpolate on module initialization.So please suggest any other method
In your blade code simply add # to Angular braces.
Example:
#{{name}}
This tells blade not to parse or treat the braces as blade code but to ignore the braces and simply output
{{name}}
Read Blade section in Laravel documentation for more info.
You can change angular syntax using $interpolationProvider:
var sampleApp = angular.module('sampleApp', [], function($interpolateProvider) {
$interpolateProvider.startSymbol('<%');
$interpolateProvider.endSymbol('%>');
});
Or change blade template configuration using Blade facade
Blade::setContentTags('<%', '%>');
Blade::setEscapedContentTags('<%%', '%%>');
One of these stragegy will be mandatory if you are using blade and angular
You'd better re-think of your app structure and use Laravel for WebServices only.

Angular-ui-bootstrap typehead not working with AngularJS 1.2.0-rc3

Here is a working example of Angular-ui-bootstrap typehead working with AngularJS 1.0.5:
http://plnkr.co/edit/me20JzvukYbK0WGy6fn4
The template uses ng-bind-html-unsafe witch is deprecated in AngularJS 1.2.0-rc3.
How can I bind html unsafe in that template? I would have used ng-bind but the filter typeaheadHighlight:query adds tags in match.model.title.
Thanks!
AngularJS removed the ng-bind-html-unsafe tag in its 1.2RC version which breaks the default typeahead template. But you have at least 2 ways to work-around it:
Move to the version 0.6.0 of the angular-ui/bootstrap library that has an equivalent tag named bind-html, here is a working plunk: http://plnkr.co/edit/D84pG1WwutE4lRU46FIs?p=preview
Include the ngSanitize module and use AngularJS built-in ng-bind-html directive: http://plnkr.co/edit/9Q2Zp3BTQbstv9AjvVg4?p=preview

Resources