codingdir logo sitemap sitemap |
Home
PHP
C#
C++
ANDROID
JAVA
JAVASCRIPT
PYTHON

AngularJS - templateUrl path appended to href path


By : , Category : angularjs

Use the <base> tag :

<base href="/" />
ReLated :

My suggestion for you is to put your views folder inside the public folder:-

bin
node_modules
public
|-- js
|    |-- main.js
|--views
    |-- template.jade
    |-- index.jade
routes
app.js
package.json

And then use

app.directive('personRecord', function(http){
    return {
        restrict : 'AE',
        templateUrl : 'views/template.jade',
        link : function(scope, ele, attr){

        }
    };
});

Hope it helps :)

From the AngularJS documentation:

Angular normalizes an element's tag and attribute name to determine which elements match which directives. We typically refer to directives by their case-sensitive camelCase normalized name (e.g. ngModel). However, since HTML is case-insensitive, we refer to directives in the DOM by lower-case forms, typically using dash-delimited attributes on DOM elements (e.g. ng-model).

You should use this:

<side-nav info="SideNav"></side-nav>

More info in https://docs.angularjs.org/guide/directive

Controllers are reloaded whenever there is a route change, losing their state. If you want to keep the input value, you'll need to pass it to a service and then retrieve it from the other controller.

you can check ng-include documentation https://docs.angularjs.org/api/ng/directive/ngInclude there is example.

there is another way. you can add new element directive and include it

Comments


Message :
Login to Add Your Comments .
How to disable registered OpenCL platforms on Windows?
Is Observable broken in Angular 2 Beta 3?
Cross-thread operation not valid when using Invoke
How to pass an IEnumerable or queryable list of properties from Controller to View
Finding numbers after a certain keyword using Python
Pocketsphinx recognizes random phrases in a silence
Passing non-thread-safe objects through thread-safe containers
React scroll nav
BizTalk WCF-BasicHttp Adapter does not allow Empty string for Service Certificate Props
Why property ''cause" of Exception is repeating forever?
Privacy Policy 2017 © codingdir.com All Rights Reserved .