1

I developing a SPA using the native directive from angular ng-view to change views, the problem is that One of those views there is a custom directive I've wrote and when the route is loaded the directive doesnt work.

Here it is the config method of the App and the custom directive that doesn't fire up :S

climbingApp.config(
        function( $routeProvider ){
            $routeProvider.

            when('/', {
                controller: 'AppCtrl'
            }).

            when('/newSector', {
                template: '<formNewSector></formNewSector>',
                controller: 'addSector',
            }).

            otherwise({ redirectTo: '/'});
        }
    );


climbingApp.directives

        .directive(
            'formNewSector',
            function() {

                return {
                    restrict: 'E',
                    template: "<div>gato</div>",
                    replace: true,
                    link: function( scope, iElement, iAttrs ){

                    }
                }
    });
1
  • Can you put your markup here also? Commented Oct 15, 2013 at 20:33

1 Answer 1

3

You misspelled markup for directive in your template. For directive named formNewSector it should be <form-new-sector>, not <formNewSector>.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.