Skip to main content

ng-include in angularjs

Ng-include Directive :

        An ng-include is use to inject a DOM in any html pages. This inject DOM component is active scope in mention or declared controllers.

       A purpose of ng-include is reuse the DOM component in more than pages. Say for example header page section is common to the all pages means, This DOM element move to one file and than this file include all the pages.

<ng-include src="" onload="" autoscroll="">
 
or

<div ng-include="" onload="" autoscroll="">


src  - give your dom component file path.
onload - any action you will make on load the dom
autoscroll - if need scroll you can apply here

Sample:

<div ng-include="'templates/include/header_tpl.html'"></div>
 or
<div ng-include="'templates/include/header.tpl'"></div>

.tpl or .html you save the template file format. These format is supported ng-include.

<ion-view>
<div ng-include="'templates/include/header.tpl'"></div>
  <ion-content >  
       <div >EVENTS</div>
          .................
        </div>
</ion-content>
</ion-view>
       

Comments

Popular posts from this blog

How has lockdown impacted Indian farmers?

How has lockdown impacted Indian farmers?             Generally compare to other sectors it's not major impacted by our Indian farmers but we acceptable minor impacts. Here we separate major two farming cultures one is mono farming culture another one poly farming culture. Mono farming :             The major impacts from our Indian farmer for monoculture. Here I have briefly explained what are the things we had faced our local farmers. Here I explain two different crops type: Daily crops : * We harvest more than 100-kilo grams daily crops like brinjal but we unable to sell those in local markets. * We are unable to reach urban markets. * We don't have enough transport facilities. * We unable buy require fertilizer and other complements * In the early stage we are facing manpower shortage but later it's not an issue. * We unable to do value-added products. * Waste is very high for somedays Se...

How is a startup possible in farming and agriculture?

                 In this question we have two options, The first one is natural farming and another one is chemical farming. Both are the way to start an agriculture startup. Before we jump into the topic we have to look at more important things like Financial, Yield, quality of food and Marketing these are the very challenge we face. Chemical Farming 1. Capital & financial   * an agriculture startup we must have to invest for own land but chemical farming not require to buy an own land because chemical farming land does not produce yield more than 10 years so best you can acquire rental land.  * We have to buy cultivate equipment and machinery for chemical farming. In this case, we have two options       1. More necessity things are bought own equipment         2. Fewer necessities things go for a rental.   * Make a sufficient fund for runnin...

Sensors

A sensor can be identifying the environment changes from the surrounding of the device. In the earth who are live plants, animals and human beings have some basic sensing behavior by nature, so those approaches and behaviors we fallowed and implement to nonliving things. These are the major behavior we identify from the sensors like light, sound, motion, temperature, pressure, acceleration, position, Object presence, and Air. Here I'm sharing few components 1. Temperature Sensor Temperature sensor sensing the circumstance of temperature in the installed places. 2. Ultrasonics Sensor Using ultrasonic to identify the obstacle distance in front of the device and based on the data we can manipulate the application. 3. Pressure Sensor Find the pressure value on the device to you gave the pressure on it. 4. Water Level Sensor A water level sensor sensing the water level in the water tank and based on value trigger the applications.  5. Motion Sensor The mot...