Angular

  • Angular uses Expressions to bind data to HTML.
  • Expressions in Angular can be written inside double braces {{expression}}.
  • Angular expressions can also be written as ng-bind=” expression” inside a directive.
  • The expression will be resolved by Angular, and the result will be returned exactly where the expression was written.
  • Expressions in Angular are similar to JavaScript expressions in that they can contain literals, variables, and operators.
  • If the ng-app directive is removed, HTML will display the expression as is, without solving it.
  • Angular will simply resolve the expression and deliver the result, so you may write expressions wherever you want.
  • An application is defined by an Angular module.
  • A module is a container for an application’s various components.
  • The application controllers are contained in the module.
  • Controllers are always associated with a module.
  • The Angular function ‘angular.module’ is used to construct a module.
  • The “myApp” option refers to an HTML element that will be used to launch the application.
  • You may now add controllers, directives, filters, and other features to your Angular app.
  • Directives in Angular are extended HTML attributes with the prefix ng-.
  • An Angular application is started with the ng-app directive.
  • The ng-init directive is used to set up an application’s data.
  • The ng-model directive connects HTML controls to application data.
  • The ‘ng-app’ directive additionally informs Angular that the <div> element is the “owner” of the App.
  • The view is the HTML container in which the Angular application is shown.
  • The view has access to the model, and it can show model data in a variety of ways.
  • You can use the ng-bind directive to bind the element’s innerHTML to the model property you specify.
  • Double braces can also be used to display content from the model.
  • To link the model to the view, you can use the ng-model directive on HTML controls.
  • Controllers are used to control Angular applications.
  • The application controller is defined using the ng-controller directive.
  • A controller is a JavaScript Object that may be constructed using any JavaScript object constructor.
  • Controllers are frequently stored in external files in larger applications.
  • The binding part between the HTML (view) and the JavaScript is the scope (controller).
  • A scope is an object that contains all of the properties and methods that are available.
  • Both the view and the controller have access to the scope.
  • In Angular, you pass the $scope object as an argument when creating a controller.
  • The view (HTML) gets access to these properties when properties are added to the $scope object in the controller.
  • You don’t use the prefix $scope in the view; instead, you refer to a property by its name.
  • A service in Angular is a function or object that is only available for your Angular application.
  • There are about 30 built-in services in Angular.
  • The $location service is one of them.
  • The $location service includes methods that return information about the current web page’s location.
  • The $location service is supplied as a parameter to the controller.
  • The service must be declared as a dependency in order to be used in the controller.
  • .get()
  • .delete()
  • .head()
  • .patch()
  • .jsonp()
  • .put()
  • .post()
  • Object comparison
  • Object iteration
  • Data conversion
    The angular object is used to access the Global API functionalities.
  • Service
  • Value
  • Factory
  • Constant
  • Provider

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store